pub struct MemoryFileSystem { /* private fields */ }Expand description
In-memory VFS shared between sync and async trait objects via Arc.
Clone to hand the same state to multiple adapters.
Implementations§
Trait Implementations§
Source§impl AsyncFileSystem for MemoryFileSystem
impl AsyncFileSystem for MemoryFileSystem
Source§fn create_dir_all<'a>(&'a self, path: &'a Path) -> BoxFuture<'a, Result<()>>
fn create_dir_all<'a>(&'a self, path: &'a Path) -> BoxFuture<'a, Result<()>>
Async variant of
FileSystem::create_dir_all.Source§fn remove_dir_all<'a>(&'a self, path: &'a Path) -> BoxFuture<'a, Result<()>>
fn remove_dir_all<'a>(&'a self, path: &'a Path) -> BoxFuture<'a, Result<()>>
Async variant of
FileSystem::remove_dir_all.Source§fn try_exists<'a>(&'a self, path: &'a Path) -> BoxFuture<'a, Result<bool>>
fn try_exists<'a>(&'a self, path: &'a Path) -> BoxFuture<'a, Result<bool>>
Async variant of
FileSystem::try_exists.Source§fn open_read<'a>(
&'a self,
path: &'a Path,
) -> BoxFuture<'a, Result<Box<dyn AsyncFileRead>>>
fn open_read<'a>( &'a self, path: &'a Path, ) -> BoxFuture<'a, Result<Box<dyn AsyncFileRead>>>
Async variant of
FileSystem::open_read.Source§fn open_write<'a>(
&'a self,
path: &'a Path,
) -> BoxFuture<'a, Result<Box<dyn AsyncFileWrite>>>
fn open_write<'a>( &'a self, path: &'a Path, ) -> BoxFuture<'a, Result<Box<dyn AsyncFileWrite>>>
Async variant of
FileSystem::open_write.Source§impl Clone for MemoryFileSystem
impl Clone for MemoryFileSystem
Source§fn clone(&self) -> MemoryFileSystem
fn clone(&self) -> MemoryFileSystem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryFileSystem
impl Debug for MemoryFileSystem
Source§impl Default for MemoryFileSystem
impl Default for MemoryFileSystem
Source§fn default() -> MemoryFileSystem
fn default() -> MemoryFileSystem
Returns the “default value” for a type. Read more
Source§impl FileSystem for MemoryFileSystem
impl FileSystem for MemoryFileSystem
Source§fn create_dir_all(&self, path: &Path) -> Result<()>
fn create_dir_all(&self, path: &Path) -> Result<()>
Create a directory and all missing parents. Idempotent: succeeds
if the directory already exists.
Source§fn remove_dir_all(&self, path: &Path) -> Result<()>
fn remove_dir_all(&self, path: &Path) -> Result<()>
Remove a directory and all of its contents recursively.
ErrorKind::NotFound if the path does not exist.Source§fn try_exists(&self, path: &Path) -> Result<bool>
fn try_exists(&self, path: &Path) -> Result<bool>
Returns
Ok(true) if the path exists, Ok(false) if it does
not, and a non-NotFound error for any other condition
(for example permission denied).Source§fn open_read(&self, path: &Path) -> Result<Box<dyn FileRead>>
fn open_read(&self, path: &Path) -> Result<Box<dyn FileRead>>
Open an existing file for reading.
ErrorKind::NotFound if the
file does not exist.Source§fn open_write(&self, path: &Path) -> Result<Box<dyn FileWrite>>
fn open_write(&self, path: &Path) -> Result<Box<dyn FileWrite>>
Open a file for writing, creating it if absent and truncating
it if present. Missing parent directories produce
ErrorKind::NotFound.Auto Trait Implementations§
impl Freeze for MemoryFileSystem
impl RefUnwindSafe for MemoryFileSystem
impl Send for MemoryFileSystem
impl Sync for MemoryFileSystem
impl Unpin for MemoryFileSystem
impl UnsafeUnpin for MemoryFileSystem
impl UnwindSafe for MemoryFileSystem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more