Struct diskplan_filesystem::MemoryFilesystem
source · pub struct MemoryFilesystem { /* private fields */ }
Expand description
An in-memory representation of a file system
Implementations§
source§impl MemoryFilesystem
impl MemoryFilesystem
sourcepub fn to_path_set(&self) -> HashSet<&Utf8Path>
pub fn to_path_set(&self) -> HashSet<&Utf8Path>
For use by tests to compare with expected results
Trait Implementations§
source§impl Default for MemoryFilesystem
impl Default for MemoryFilesystem
source§impl Filesystem for MemoryFilesystem
impl Filesystem for MemoryFilesystem
source§fn create_directory(
&mut self,
path: impl AsRef<Utf8Path>,
attrs: SetAttrs<'_>
) -> Result<()>
fn create_directory( &mut self, path: impl AsRef<Utf8Path>, attrs: SetAttrs<'_> ) -> Result<()>
Create a directory at the given path, with any number of attributes set
source§fn create_file(
&mut self,
path: impl AsRef<Utf8Path>,
attrs: SetAttrs<'_>,
content: String
) -> Result<()>
fn create_file( &mut self, path: impl AsRef<Utf8Path>, attrs: SetAttrs<'_>, content: String ) -> Result<()>
Create a file with the given content and any number of attributes set
source§fn create_symlink(
&mut self,
path: impl AsRef<Utf8Path>,
target: impl AsRef<Utf8Path>
) -> Result<()>
fn create_symlink( &mut self, path: impl AsRef<Utf8Path>, target: impl AsRef<Utf8Path> ) -> Result<()>
Create a symlink pointing to the given target
source§fn is_directory(&self, path: impl AsRef<Utf8Path>) -> bool
fn is_directory(&self, path: impl AsRef<Utf8Path>) -> bool
Returns true if the path is a directory
source§fn is_file(&self, path: impl AsRef<Utf8Path>) -> bool
fn is_file(&self, path: impl AsRef<Utf8Path>) -> bool
Returns true if the path is a regular file
source§fn is_link(&self, path: impl AsRef<Utf8Path>) -> bool
fn is_link(&self, path: impl AsRef<Utf8Path>) -> bool
Returns true if the path is a symbolic link
source§fn list_directory(&self, path: impl AsRef<Utf8Path>) -> Result<Vec<String>>
fn list_directory(&self, path: impl AsRef<Utf8Path>) -> Result<Vec<String>>
Lists the contents of the given directory
source§fn read_file(&self, path: impl AsRef<Utf8Path>) -> Result<String>
fn read_file(&self, path: impl AsRef<Utf8Path>) -> Result<String>
Reads the contents of the given file
source§fn read_link(&self, path: impl AsRef<Utf8Path>) -> Result<Utf8PathBuf>
fn read_link(&self, path: impl AsRef<Utf8Path>) -> Result<Utf8PathBuf>
Reads the path pointed to by the given symbolic link
source§fn attributes(&self, path: impl AsRef<Utf8Path>) -> Result<Attrs<'_>>
fn attributes(&self, path: impl AsRef<Utf8Path>) -> Result<Attrs<'_>>
Returns the attributes of the given file, directory Read more
source§fn set_attributes(
&mut self,
path: impl AsRef<Utf8Path>,
set_attrs: SetAttrs<'_>
) -> Result<()>
fn set_attributes( &mut self, path: impl AsRef<Utf8Path>, set_attrs: SetAttrs<'_> ) -> Result<()>
Sets the attributes of the given file or directory Read more
source§fn create_directory_all(
&mut self,
path: impl AsRef<Utf8Path>,
attrs: SetAttrs<'_>
) -> Result<()>
fn create_directory_all( &mut self, path: impl AsRef<Utf8Path>, attrs: SetAttrs<'_> ) -> Result<()>
Create a directory and all of its parents
source§fn canonicalize(&self, path: impl AsRef<Utf8Path>) -> Result<Utf8PathBuf>
fn canonicalize(&self, path: impl AsRef<Utf8Path>) -> Result<Utf8PathBuf>
Returns the path after following all symlinks, normalized and absolute
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryFilesystem
impl Send for MemoryFilesystem
impl !Sync for MemoryFilesystem
impl Unpin 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