pub struct DiskFileSystem { /* private fields */ }
Implementations§
Source§impl DiskFileSystem
impl DiskFileSystem
pub fn name(&self) -> &RcStr
pub fn root(&self) -> &RcStr
pub fn invalidate(&self)
pub fn invalidate_with_reason<R: InvalidationReason + Clone>( &self, reason: impl Fn(&Path) -> R + Sync, )
pub async fn start_watching( &self, poll_interval: Option<Duration>, ) -> Result<()>
pub async fn start_watching_with_invalidation_reason( &self, poll_interval: Option<Duration>, ) -> Result<()>
pub fn stop_watching(&self)
Sourcepub fn try_from_sys_path(
&self,
vc_self: ResolvedVc<DiskFileSystem>,
sys_path: &Path,
relative_to: Option<&FileSystemPath>,
) -> Option<FileSystemPath>
pub fn try_from_sys_path( &self, vc_self: ResolvedVc<DiskFileSystem>, sys_path: &Path, relative_to: Option<&FileSystemPath>, ) -> Option<FileSystemPath>
Try to convert Path
to FileSystemPath
. Return None
if the file path leaves the
filesystem root. If no relative_to
argument is given, it is assumed that the sys_path
is
relative to the DiskFileSystem
root.
Attempts to convert absolute paths to paths relative to the filesystem root, though we only attempt to do so lexically.
Assumes self
is the DiskFileSystem
contained in vc_self
. This API is a bit awkward
because:
Path
/PathBuf
should not be stored in the filesystem cache, so the function cannot be aturbo_tasks::function
.- It’s a little convenient for this function to be sync.
pub fn to_sys_path(&self, fs_path: &FileSystemPath) -> PathBuf
Source§impl DiskFileSystem
impl DiskFileSystem
Sourcepub fn new(name: RcStr, root: RcStr) -> Vc<Self>
pub fn new(name: RcStr, root: RcStr) -> Vc<Self>
Create a new instance of DiskFileSystem
.
§Arguments
name
- Name of the filesystem.root
- Path to the given filesystem’s root. Should be canonicalized.
Sourcepub fn new_with_denied_path(
name: RcStr,
root: RcStr,
denied_path: RcStr,
) -> Vc<Self>
pub fn new_with_denied_path( name: RcStr, root: RcStr, denied_path: RcStr, ) -> Vc<Self>
Create a new instance of DiskFileSystem
.
§Arguments
name
- Name of the filesystem.root
- Path to the given filesystem’s root. Should be canonicalized.denied_path
- A path within this filesystem that is not allowed to be accessed or navigated into. This must be normalized, non-empty and relative to the fs root.
Trait Implementations§
Source§impl Debug for DiskFileSystem
impl Debug for DiskFileSystem
Source§impl<'de> Deserialize<'de> for DiskFileSystem
impl<'de> Deserialize<'de> for DiskFileSystem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FileSystem for DiskFileSystem
impl FileSystem for DiskFileSystem
fn read(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<FileContent>
fn raw_read_dir( self: Vc<Self>, fs_path: FileSystemPath, ) -> Vc<RawDirectoryContent>
fn read_link(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<LinkContent>
fn write( self: Vc<Self>, fs_path: FileSystemPath, content: Vc<FileContent>, ) -> Vc<()>
fn write_link( self: Vc<Self>, fs_path: FileSystemPath, target: Vc<LinkContent>, ) -> Vc<()>
fn metadata(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<FileMeta>
Source§fn root(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
fn root(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
Returns the path to the root of the file system.
Source§impl Serialize for DiskFileSystem
impl Serialize for DiskFileSystem
Source§impl ShrinkToFit for DiskFileSystem
impl ShrinkToFit for DiskFileSystem
fn shrink_to_fit(&mut self)
Source§impl TraceRawVcs for DiskFileSystem
impl TraceRawVcs for DiskFileSystem
fn trace_raw_vcs(&self, __context__: &mut TraceRawVcsContext)
fn get_raw_vcs(&self) -> Vec<RawVc>
Source§impl ValueDebug for DiskFileSystem
impl ValueDebug for DiskFileSystem
Source§impl ValueDebugFormat for DiskFileSystem
impl ValueDebugFormat for DiskFileSystem
fn value_debug_format<'a>(&'a self, depth: usize) -> ValueDebugFormatString<'a>
Source§impl VcValueType for DiskFileSystem
impl VcValueType for DiskFileSystem
Source§type Read = VcDefaultRead<DiskFileSystem>
type Read = VcDefaultRead<DiskFileSystem>
How to read the value.
Source§type CellMode = VcCellNewMode<DiskFileSystem>
type CellMode = VcCellNewMode<DiskFileSystem>
How to update cells of this value type.
Source§fn get_value_type_id() -> ValueTypeId
fn get_value_type_id() -> ValueTypeId
Returns the type id of the value type.
impl NonLocalValue for DiskFileSystem
impl Upcast<Box<dyn FileSystem>> for DiskFileSystem
impl Upcast<Box<dyn ValueDebug>> for DiskFileSystem
impl Upcast<Box<dyn ValueToString>> for DiskFileSystem
impl UpcastStrict<Box<dyn FileSystem>> for DiskFileSystem
impl UpcastStrict<Box<dyn ValueDebug>> for DiskFileSystem
impl UpcastStrict<Box<dyn ValueToString>> for DiskFileSystem
Auto Trait Implementations§
impl Freeze for DiskFileSystem
impl !RefUnwindSafe for DiskFileSystem
impl Send for DiskFileSystem
impl Sync for DiskFileSystem
impl Unpin for DiskFileSystem
impl !UnwindSafe for DiskFileSystem
Blanket Implementations§
§impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.