[−][src]Struct memofs::InMemoryFs
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]
&mut self,
path: P,
snapshot: VfsSnapshot
) -> Result<()>
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]
pub fn clone(&self) -> InMemoryFs
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for InMemoryFs
[src]
impl VfsBackend for InMemoryFs
[src]
pub fn read(&mut self, path: &Path) -> Result<Vec<u8>>
[src]
pub fn write(&mut self, path: &Path, data: &[u8]) -> Result<()>
[src]
pub fn read_dir(&mut self, path: &Path) -> Result<ReadDir>
[src]
pub fn remove_file(&mut self, path: &Path) -> Result<()>
[src]
pub fn remove_dir_all(&mut self, path: &Path) -> Result<()>
[src]
pub fn metadata(&mut self, path: &Path) -> Result<Metadata>
[src]
pub fn event_receiver(&self) -> Receiver<VfsEvent>
[src]
pub fn watch(&mut self, _path: &Path) -> Result<()>
[src]
pub fn unwatch(&mut self, _path: &Path) -> Result<()>
[src]
Auto Trait Implementations
impl RefUnwindSafe for InMemoryFs
impl Send for InMemoryFs
impl Sync for InMemoryFs
impl Unpin for InMemoryFs
impl UnwindSafe for InMemoryFs
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,