pub struct MountTable { /* private fields */ }Implementations§
Source§impl MountTable
impl MountTable
pub fn new(root_fs: impl VirtualFileSystem + 'static) -> MountTable
pub fn new_boxed_root( filesystem: Box<dyn MountedFileSystem>, options: MountOptions, ) -> MountTable
pub fn mount( &mut self, path: &str, filesystem: impl VirtualFileSystem + 'static, options: MountOptions, ) -> Result<(), VfsError>
pub fn mount_boxed( &mut self, path: &str, filesystem: Box<dyn MountedFileSystem>, options: MountOptions, ) -> Result<(), VfsError>
pub fn unmount(&mut self, path: &str) -> Result<(), VfsError>
pub fn get_mounts(&self) -> Vec<MountEntry>
pub fn root_virtual_filesystem_mut<T>(&mut self) -> Option<&mut T>where
T: VirtualFileSystem + 'static,
pub fn check_rename_copy_up_limits( &mut self, old_path: &str, new_path: &str, max_bytes: Option<u64>, max_inodes: Option<usize>, ) -> Result<(), VfsError>
pub fn root_usage(&mut self) -> Result<FileSystemUsage, VfsError>
Trait Implementations§
Source§impl Drop for MountTable
impl Drop for MountTable
Source§impl VirtualFileSystem for MountTable
impl VirtualFileSystem for MountTable
fn read_file(&mut self, path: &str) -> Result<Vec<u8>, VfsError>
fn read_dir(&mut self, path: &str) -> Result<Vec<String>, VfsError>
fn read_dir_limited( &mut self, path: &str, max_entries: usize, ) -> Result<Vec<String>, VfsError>
fn read_dir_with_types( &mut self, path: &str, ) -> Result<Vec<VirtualDirEntry>, VfsError>
Source§fn write_file(
&mut self,
path: &str,
content: impl Into<Vec<u8>>,
) -> Result<(), VfsError>
fn write_file( &mut self, path: &str, content: impl Into<Vec<u8>>, ) -> Result<(), VfsError>
Writes caller-owned bytes into the filesystem. Read more
fn write_file_with_mode( &mut self, path: &str, content: impl Into<Vec<u8>>, mode: Option<u32>, ) -> Result<(), VfsError>
fn create_file_exclusive( &mut self, path: &str, content: impl Into<Vec<u8>>, ) -> Result<(), VfsError>
fn create_file_exclusive_with_mode( &mut self, path: &str, content: impl Into<Vec<u8>>, mode: Option<u32>, ) -> Result<(), VfsError>
Source§fn append_file(
&mut self,
path: &str,
content: impl Into<Vec<u8>>,
) -> Result<u64, VfsError>
fn append_file( &mut self, path: &str, content: impl Into<Vec<u8>>, ) -> Result<u64, VfsError>
Appends caller-owned bytes into the filesystem after checking that the
in-memory file can grow without overflowing addressable memory.
fn create_dir(&mut self, path: &str) -> Result<(), VfsError>
fn create_dir_with_mode( &mut self, path: &str, mode: Option<u32>, ) -> Result<(), VfsError>
fn mkdir(&mut self, path: &str, recursive: bool) -> Result<(), VfsError>
fn mkdir_with_mode( &mut self, path: &str, recursive: bool, mode: Option<u32>, ) -> Result<(), VfsError>
fn exists(&self, path: &str) -> bool
fn stat(&mut self, path: &str) -> Result<VirtualStat, VfsError>
fn remove_file(&mut self, path: &str) -> Result<(), VfsError>
fn remove_dir(&mut self, path: &str) -> Result<(), VfsError>
fn rename(&mut self, old_path: &str, new_path: &str) -> Result<(), VfsError>
fn realpath(&self, path: &str) -> Result<String, VfsError>
fn symlink(&mut self, target: &str, link_path: &str) -> Result<(), VfsError>
fn read_link(&self, path: &str) -> Result<String, VfsError>
fn lstat(&self, path: &str) -> Result<VirtualStat, VfsError>
fn link(&mut self, old_path: &str, new_path: &str) -> Result<(), VfsError>
fn chmod(&mut self, path: &str, mode: u32) -> Result<(), VfsError>
fn chown(&mut self, path: &str, uid: u32, gid: u32) -> Result<(), VfsError>
fn utimes( &mut self, path: &str, atime_ms: u64, mtime_ms: u64, ) -> Result<(), VfsError>
fn utimes_spec( &mut self, path: &str, atime: VirtualUtimeSpec, mtime: VirtualUtimeSpec, follow_symlinks: bool, ) -> Result<(), VfsError>
Source§fn truncate(&mut self, path: &str, length: u64) -> Result<(), VfsError>
fn truncate(&mut self, path: &str, length: u64) -> Result<(), VfsError>
Resizes a file. VM resource policy must be enforced by the caller.
fn pread( &mut self, path: &str, offset: u64, length: usize, ) -> Result<Vec<u8>, VfsError>
fn read_text_file(&mut self, path: &str) -> Result<String, VfsError>
Auto Trait Implementations§
impl !RefUnwindSafe for MountTable
impl !Send for MountTable
impl !Sync for MountTable
impl !UnwindSafe for MountTable
impl Freeze for MountTable
impl Unpin for MountTable
impl UnsafeUnpin for MountTable
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more