Skip to main content

FileSystem

Trait FileSystem 

Source
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 is_junction_point(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<bool>
       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<WriteLinkContent>,
    ) -> 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§

Source

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

Reads the target of a symbolic link (or junction point on Windows). See LinkContent.

Source

fn is_junction_point(self: Vc<Self>, fs_path: FileSystemPath) -> Vc<bool>
where Self: Sized,

Returns whether a symbolic link is a junction point on Windows. Always false on all other platforms.

Source

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

Source

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

Creates a symbolic link. See WriteLinkContent and FileSystemPath::write_link.

Source

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

Provided Methods§

Source

fn root(self: Vc<Self>) -> Vc<FileSystemPath>
where Self: Sized,

Returns the path to the root of the file system.

Trait Implementations§

Source§

impl Dynamic<Box<dyn FileSystem>> for Box<dyn FileSystem>

Source§

impl Dynamic<Box<dyn ValueDebug>> for Box<dyn FileSystem>

Available on debug-assertions enabled only.
Source§

impl Dynamic<Box<dyn ValueToString>> for Box<dyn FileSystem>

Source§

impl TraitVtablePrototype for Box<dyn FileSystem>

Source§

const LEN: usize = 8usize

Source§

const DEFAULTS: &[Option<&NativeFunction>]

Source§

impl Upcast<Box<dyn FileSystem>> for DiskFileSystem

Source§

impl Upcast<Box<dyn FileSystem>> for EmbeddedFileSystem

Source§

impl Upcast<Box<dyn FileSystem>> for NullFileSystem

Source§

impl Upcast<Box<dyn FileSystem>> for VirtualFileSystem

Source§

impl Upcast<Box<dyn FileSystem>> for Box<dyn FileSystem>

Source§

impl Upcast<Box<dyn ValueDebug>> for Box<dyn FileSystem>

Available on debug-assertions enabled only.
Source§

impl Upcast<Box<dyn ValueToString>> for Box<dyn FileSystem>

Source§

impl UpcastStrict<Box<dyn FileSystem>> for DiskFileSystem

Source§

impl UpcastStrict<Box<dyn FileSystem>> for EmbeddedFileSystem

Source§

impl UpcastStrict<Box<dyn FileSystem>> for NullFileSystem

Source§

impl UpcastStrict<Box<dyn FileSystem>> for VirtualFileSystem

Source§

impl UpcastStrict<Box<dyn ValueDebug>> for Box<dyn FileSystem>

Available on debug-assertions enabled only.
Source§

impl UpcastStrict<Box<dyn ValueToString>> for Box<dyn FileSystem>

Source§

impl VcValueTrait for Box<dyn FileSystem>

Source§

const IMPL_VTABLES: &'static VTableRegistry<Self::ValueTrait>

The per-trait vtable registry, populated by [crate::value_type::register_all_trait_methods] Read more
Source§

type ValueTrait = dyn FileSystem

Source§

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

Implementors§

Source§

impl FileSystem for DiskFileSystem

Source§

impl FileSystem for EmbeddedFileSystem

Source§

impl FileSystem for NullFileSystem

Source§

impl FileSystem for VirtualFileSystem

Source§

impl<T> FileSystem for T
where T: Dynamic<Box<dyn FileSystem>> + ValueToString + Send + Sync + NonLocalValue + ValueDebug,