[][src]Struct memofs::InMemoryFs

pub struct InMemoryFs { /* fields omitted */ }

In-memory filesystem that can be used as a VFS backend.

Internally reference counted to enable giving a copy to Vfs and keeping the original to mutate the filesystem's state with.

Implementations

impl InMemoryFs[src]

pub fn new() -> Self[src]

Create a new empty InMemoryFs.

pub fn load_snapshot<P: Into<PathBuf>>(
    &mut self,
    path: P,
    snapshot: VfsSnapshot
) -> Result<()>
[src]

Load a VfsSnapshot into a subtree of the in-memory filesystem.

This function will return an error if the operations required to apply the snapshot result in errors, like trying to create a file inside a file.

pub fn raise_event(&mut self, event: VfsEvent)[src]

Raises a filesystem change event.

If this InMemoryFs is being used as the backend of a Vfs, then any listeners be notified of this event.

Trait Implementations

impl Clone for InMemoryFs[src]

impl Debug for InMemoryFs[src]

impl VfsBackend for InMemoryFs[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.