pub struct StdVfs;Expand description
Standard-library-backed production filesystem.
Trait Implementations§
impl Copy for StdVfs
Source§impl Vfs for StdVfs
impl Vfs for StdVfs
Source§fn truncate(&self, path: &Path, length: u64) -> Result<()>
fn truncate(&self, path: &Path, length: u64) -> Result<()>
Removes a suffix without copying the retained file bytes.
Source§fn create_new(&self, path: &Path, bytes: &[u8]) -> Result<()>
fn create_new(&self, path: &Path, bytes: &[u8]) -> Result<()>
Exclusively creates a file and writes every byte without replacing any
existing path. A failed write may leave a new partial file; callers must
retain it as an uncommitted artifact until safe cleanup is established.
Filesystems without atomic exclusive creation fail explicitly.
Source§fn ensure_directory(&self, path: &Path, create: bool) -> Result<bool>
fn ensure_directory(&self, path: &Path, create: bool) -> Result<bool>
Admits a store directory, creating missing ancestors when requested,
and reports whether the resulting path is a directory.
Source§fn create_directory(&self, path: &Path) -> Result<()>
fn create_directory(&self, path: &Path) -> Result<()>
Exclusively creates one directory. Existing paths are preserved and
reported as
AlreadyExists; no ancestor is adopted implicitly.Source§fn remove_directory(&self, path: &Path) -> Result<()>
fn remove_directory(&self, path: &Path) -> Result<()>
Removes one empty directory. A non-empty directory is an error.
Source§fn open(&self, path: &Path) -> Result<u64>
fn open(&self, path: &Path) -> Result<u64>
Opens an existing path and returns its byte length.
Source§fn open_for_map(&self, path: &Path) -> Result<File>
fn open_for_map(&self, path: &Path) -> Result<File>
Opens an existing path as an owned file suitable for memory mapping. Read more
Source§fn read_range(&self, path: &Path, offset: u64, length: usize) -> Result<Vec<u8>>
fn read_range(&self, path: &Path, offset: u64, length: usize) -> Result<Vec<u8>>
Reads at most
length bytes beginning at offset.Source§fn write(&self, path: &Path, bytes: &[u8]) -> Result<()>
fn write(&self, path: &Path, bytes: &[u8]) -> Result<()>
Creates or truncates a file and writes all bytes.
Source§fn open_append(&self, path: &Path) -> Result<Box<dyn VfsFile>>
fn open_append(&self, path: &Path) -> Result<Box<dyn VfsFile>>
Opens or creates one file for handle-oriented append-only writes.
Source§fn rename(&self, from: &Path, to: &Path) -> Result<()>
fn rename(&self, from: &Path, to: &Path) -> Result<()>
Atomically renames one path over another according to platform semantics.
Source§fn sync(&self, path: &Path, kind: SyncKind) -> Result<()>
fn sync(&self, path: &Path, kind: SyncKind) -> Result<()>
Synchronizes a file or directory using an explicit platform primitive.
Source§fn list(&self, directory: &Path) -> Result<Vec<PathBuf>>
fn list(&self, directory: &Path) -> Result<Vec<PathBuf>>
Lists direct children of a directory.
Auto Trait Implementations§
impl Freeze for StdVfs
impl RefUnwindSafe for StdVfs
impl Send for StdVfs
impl Sync for StdVfs
impl Unpin for StdVfs
impl UnsafeUnpin for StdVfs
impl UnwindSafe for StdVfs
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