[][src]Struct mini_fs::MiniFs

pub struct MiniFs { /* fields omitted */ }

Virtual filesystem.

Methods

impl MiniFs[src]

pub fn new() -> Self[src]

pub fn mount<P, F>(self, path: P, store: F) -> Self where
    P: Into<PathBuf>,
    F: Store + Send + 'static, 
[src]

pub fn umount<P: AsRef<Path>>(&mut self, path: P) -> Option<Box<dyn Store>>[src]

Unmounts store mounted at the given location.

Returns the unmounted store if the given path was a valid mounting point. Returns None otherwise.

Example

let a = Local::new("/");
let b = Local::new("/etc");

let mut fs = MiniFs::new().mount("/", a).mount("/etc", b);

assert!(fs.umount("/etc").is_some());
assert!(fs.umount("/etc").is_none());

Trait Implementations

impl Store for MiniFs[src]

fn open_write(&self, path: &Path) -> Result<File>[src]

Opens a file in write-only mode.

Auto Trait Implementations

impl !Send for MiniFs

impl !Sync for MiniFs

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.