Struct virtual_fs::mem_fs::FileSystem
source · pub struct FileSystem { /* private fields */ }
Expand description
The in-memory file system!
This FileSystem
type can be cloned, it’s a light copy of the
FileSystemInner
(which is behind a Arc
+ RwLock
).
Implementations§
source§impl FileSystem
impl FileSystem
sourcepub fn insert_ro_file(
&self,
path: &Path,
contents: Cow<'static, [u8]>
) -> Result<()>
pub fn insert_ro_file( &self, path: &Path, contents: Cow<'static, [u8]> ) -> Result<()>
Inserts a readonly file into the file system that uses copy-on-write (this is required for zero-copy creation of the same file)
sourcepub fn insert_arc_file(
&self,
path: PathBuf,
fs: Arc<dyn FileSystem + Send + Sync>
) -> Result<()>
pub fn insert_arc_file( &self, path: PathBuf, fs: Arc<dyn FileSystem + Send + Sync> ) -> Result<()>
Inserts a arc file into the file system that references another file in another file system (does not copy the real data)
sourcepub fn insert_arc_directory(
&self,
path: PathBuf,
fs: Arc<dyn FileSystem + Send + Sync>
) -> Result<()>
pub fn insert_arc_directory( &self, path: PathBuf, fs: Arc<dyn FileSystem + Send + Sync> ) -> Result<()>
Inserts a arc directory into the file system that references another file in another file system (does not copy the real data)
sourcepub fn insert_device_file(
&self,
path: PathBuf,
file: Box<dyn VirtualFile + Send + Sync>
) -> Result<()>
pub fn insert_device_file( &self, path: PathBuf, file: Box<dyn VirtualFile + Send + Sync> ) -> Result<()>
Inserts a arc file into the file system that references another file in another file system (does not copy the real data)
source§impl FileSystem
impl FileSystem
pub fn new_open_options_ext(&self) -> &FileSystem
pub fn union(&self, other: &Arc<dyn FileSystem + Send + Sync>)
pub fn mount( &self, path: PathBuf, other: &Arc<dyn FileSystem + Send + Sync>, dst: PathBuf ) -> Result<()>
Trait Implementations§
source§impl Clone for FileSystem
impl Clone for FileSystem
source§fn clone(&self) -> FileSystem
fn clone(&self) -> FileSystem
Returns a copy 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 FileSystem
impl Debug for FileSystem
source§impl Default for FileSystem
impl Default for FileSystem
source§fn default() -> FileSystem
fn default() -> FileSystem
Returns the “default value” for a type. Read more