pub struct MemoryFS { /* private fields */ }
Expand description
An ephemeral in-memory file system, intended mainly for unit tests
Implementations
Trait Implementations
sourceimpl FileSystem for MemoryFS
impl FileSystem for MemoryFS
sourcefn read_dir(&self, path: &str) -> VfsResult<Box<dyn Iterator<Item = String>>>
fn read_dir(&self, path: &str) -> VfsResult<Box<dyn Iterator<Item = String>>>
Iterates over all entries of this directory path
sourcefn open_file(&self, path: &str) -> VfsResult<Box<dyn SeekAndRead>>
fn open_file(&self, path: &str) -> VfsResult<Box<dyn SeekAndRead>>
Opens the file at this path for reading
sourcefn create_file(&self, path: &str) -> VfsResult<Box<dyn Write>>
fn create_file(&self, path: &str) -> VfsResult<Box<dyn Write>>
Creates a file at this path for writing
sourcefn append_file(&self, path: &str) -> VfsResult<Box<dyn Write>>
fn append_file(&self, path: &str) -> VfsResult<Box<dyn Write>>
Opens the file at this path for appending
sourcefn metadata(&self, path: &str) -> VfsResult<VfsMetadata>
fn metadata(&self, path: &str) -> VfsResult<VfsMetadata>
Returns the file metadata for the file at this path
sourcefn exists(&self, path: &str) -> VfsResult<bool>
fn exists(&self, path: &str) -> VfsResult<bool>
Returns true if a file or directory at path exists, false otherwise
sourcefn remove_file(&self, path: &str) -> VfsResult<()>
fn remove_file(&self, path: &str) -> VfsResult<()>
Removes the file at this path
sourcefn remove_dir(&self, path: &str) -> VfsResult<()>
fn remove_dir(&self, path: &str) -> VfsResult<()>
Removes the directory at this path
sourcefn copy_file(&self, _src: &str, _dest: &str) -> VfsResult<()>
fn copy_file(&self, _src: &str, _dest: &str) -> VfsResult<()>
Copies the src path to the destination path within the same filesystem (optional)
Auto Trait Implementations
impl RefUnwindSafe for MemoryFS
impl Send for MemoryFS
impl Sync for MemoryFS
impl Unpin for MemoryFS
impl UnwindSafe for MemoryFS
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more