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,
Sourcefn read_link(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<LinkContent>where
Self: Sized,
fn read_link(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<LinkContent>where
Self: Sized,
Reads the target of a symbolic link (or of a junction point on Windows).
The base of the returned LinkContent::Link target depends on the link’s
LinkType: root-relative and normalized for LinkType::ABSOLUTE links, or the raw
link-relative on-disk value otherwise.
Returns LinkContent::Invalid if the target points outside of the filesystem root, and
LinkContent::NotFound if fs_path doesn’t exist or isn’t a link.
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,
Sourcefn write_link(
self: Vc<Self>,
fs_path: FileSystemPath,
target: Vc<LinkContent>,
) -> 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§
impl Dynamic<Box<dyn FileSystem>> for Box<dyn FileSystem>
impl Dynamic<Box<dyn ValueDebug>> for Box<dyn FileSystem>
Available on debug-assertions enabled only.
impl Dynamic<Box<dyn ValueToString>> for Box<dyn FileSystem>
Source§impl TraitVtablePrototype for Box<dyn FileSystem>
impl TraitVtablePrototype for Box<dyn FileSystem>
impl Upcast<Box<dyn FileSystem>> for Box<dyn FileSystem>
impl Upcast<Box<dyn ValueDebug>> for Box<dyn FileSystem>
Available on debug-assertions enabled only.
impl Upcast<Box<dyn ValueToString>> for Box<dyn FileSystem>
impl UpcastStrict<Box<dyn ValueDebug>> for Box<dyn FileSystem>
Available on debug-assertions enabled only.
impl UpcastStrict<Box<dyn ValueToString>> for Box<dyn FileSystem>
Source§impl VcValueTrait for Box<dyn FileSystem>
impl VcValueTrait for Box<dyn FileSystem>
Source§const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>
const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>
The per-trait vtable registry, populated by [crate::value_type::register_all_trait_methods] Read more
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".