DiskFileSystem

Struct DiskFileSystem 

Source
pub struct DiskFileSystem { /* private fields */ }

Implementations§

Source§

impl DiskFileSystem

Source

pub fn name(&self) -> &RcStr

Source

pub fn root(&self) -> &RcStr

Source

pub fn invalidate(&self)

Source

pub fn invalidate_with_reason<R: InvalidationReason + Clone>( &self, reason: impl Fn(&Path) -> R + Sync, )

Source

pub async fn start_watching( &self, poll_interval: Option<Duration>, ) -> Result<()>

Source

pub async fn start_watching_with_invalidation_reason( &self, poll_interval: Option<Duration>, ) -> Result<()>

Source

pub fn stop_watching(&self)

Source

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 a turbo_tasks::function.
  • It’s a little convenient for this function to be sync.
Source

pub fn to_sys_path(&self, fs_path: &FileSystemPath) -> PathBuf

Source§

impl DiskFileSystem

Source

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.
Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DiskFileSystem

Source§

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

Source§

fn read(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<FileContent>

Source§

fn raw_read_dir( self: Vc<Self>, fs_path: FileSystemPath, ) -> Vc<RawDirectoryContent>

Source§

fn write( self: Vc<Self>, fs_path: FileSystemPath, content: Vc<FileContent>, ) -> Vc<()>

Source§

fn metadata(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<FileMeta>

Source§

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

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ShrinkToFit for DiskFileSystem

Source§

fn shrink_to_fit(&mut self)

Source§

impl TraceRawVcs for DiskFileSystem

Source§

fn trace_raw_vcs(&self, __context__: &mut TraceRawVcsContext)

§

fn get_raw_vcs(&self) -> Vec<RawVc>

Source§

impl ValueDebug for DiskFileSystem

Source§

fn dbg(self: Vc<Self>) -> Vc<ValueDebugString>

Source§

fn dbg_depth(self: Vc<Self>, depth: usize) -> Vc<ValueDebugString>

Like dbg, but with a depth limit.
Source§

impl ValueDebugFormat for DiskFileSystem

Source§

fn value_debug_format<'a>(&'a self, depth: usize) -> ValueDebugFormatString<'a>

Source§

impl ValueToString for DiskFileSystem

Source§

fn to_string(self: Vc<Self>) -> Vc<RcStr>

Source§

impl VcValueType for DiskFileSystem

Source§

type Read = VcDefaultRead<DiskFileSystem>

How to read the value.
Source§

type CellMode = VcCellNewMode<DiskFileSystem>

How to update cells of this value type.
Source§

fn get_value_type_id() -> ValueTypeId

Returns the type id of the value type.
Source§

impl NonLocalValue for DiskFileSystem

Source§

impl Upcast<Box<dyn FileSystem>> for DiskFileSystem

Source§

impl Upcast<Box<dyn ValueDebug>> for DiskFileSystem

Source§

impl Upcast<Box<dyn ValueToString>> for DiskFileSystem

Source§

impl UpcastStrict<Box<dyn FileSystem>> for DiskFileSystem

Source§

impl UpcastStrict<Box<dyn ValueDebug>> for DiskFileSystem

Source§

impl UpcastStrict<Box<dyn ValueToString>> for DiskFileSystem

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn get_type_id(&self) -> TypeId

§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,