pub trait FileSystem:
ValueToString
+ Send
+ Sync
+ NonLocalValue
+ ValueDebug {
// Required methods
fn read(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<FileContent>
where Self: Sized;
fn read_link(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<LinkContent>
where Self: Sized;
fn raw_read_dir(
self: Vc<Self>,
fs_path: FileSystemPath,
) -> Vc<RawDirectoryContent>
where Self: Sized;
fn write(
self: Vc<Self>,
fs_path: FileSystemPath,
content: Vc<FileContent>,
) -> Vc<()>
where Self: Sized;
fn write_link(
self: Vc<Self>,
fs_path: FileSystemPath,
target: Vc<LinkContent>,
) -> Vc<()>
where Self: Sized;
fn metadata(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<FileMeta>
where Self: Sized;
// Provided method
fn root(self: Vc<Self>) -> Vc<FileSystemPath>
where Self: Sized { ... }
}
Required Methods§
fn read(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<FileContent>where
Self: Sized,
fn read_link(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<LinkContent>where
Self: Sized,
fn raw_read_dir(
self: Vc<Self>,
fs_path: FileSystemPath,
) -> Vc<RawDirectoryContent>where
Self: Sized,
fn write(
self: Vc<Self>,
fs_path: FileSystemPath,
content: Vc<FileContent>,
) -> Vc<()>where
Self: Sized,
fn write_link(
self: Vc<Self>,
fs_path: FileSystemPath,
target: Vc<LinkContent>,
) -> Vc<()>where
Self: Sized,
fn metadata(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<FileMeta>where
Self: Sized,
Provided Methods§
Sourcefn 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.
Trait Implementations§
Source§impl VcValueTrait for Box<dyn FileSystem>
impl VcValueTrait for Box<dyn FileSystem>
type ValueTrait = dyn FileSystem
Source§fn get_trait_type_id() -> TraitTypeId
fn get_trait_type_id() -> TraitTypeId
Returns the type id of the trait object.
Source§fn get_impl_vtables() -> &'static VTableRegistry<Self::ValueTrait>
fn get_impl_vtables() -> &'static VTableRegistry<Self::ValueTrait>
Returns the vtable for an implementation of this trait.
Panics if ValueTypeId does not implement the trait.