Skip to main content

FileSystemIsolated

Trait FileSystemIsolated 

Source
pub trait FileSystemIsolated: FileSystemProvider {
    type HostFileSystem: FileSystem;

    // Required methods
    fn isolated_root(&mut self) -> PathBuf;
    fn non_isolated_file_system() -> Self::HostFileSystem;

    // Provided method
    fn validate_path<P: AsRef<Path>>(&mut self, path: P) -> IoResult<PathBuf> { ... }
}

Required Associated Types§

Required Methods§

Source

fn isolated_root(&mut self) -> PathBuf

The root of this isolated file system. Cant only read and write file/dir inside this root.

Source

fn non_isolated_file_system() -> Self::HostFileSystem

Provided Methods§

Source

fn validate_path<P: AsRef<Path>>(&mut self, path: P) -> IoResult<PathBuf>

Validates that a path is within the isolated root. Returns an error if the path escapes the root.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§