pub struct MemFiles { /* private fields */ }Expand description
Files in memory, keyed by path (tests; a stand-in for browser storage).
Implementations§
Trait Implementations§
Source§impl FileOps for MemFiles
impl FileOps for MemFiles
fn read(&self, path: &Path) -> Result<Vec<u8>>
Source§fn write(&self, path: &Path, data: &[u8]) -> Result<()>
fn write(&self, path: &Path, data: &[u8]) -> Result<()>
Write
data to path atomically, creating its folder.Source§fn remove(&self, path: &Path) -> Result<()>
fn remove(&self, path: &Path) -> Result<()>
Remove a file; removing a missing file is not an error.
Source§fn list(&self, dir: &Path) -> Vec<(String, SystemTime)>
fn list(&self, dir: &Path) -> Vec<(String, SystemTime)>
Files directly in
dir: (file name, modified time), sorted by name.fn is_file(&self, path: &Path) -> bool
Auto Trait Implementations§
impl !Freeze for MemFiles
impl Forget for MemFiles
impl Move for MemFiles
impl RefUnwindSafe for MemFiles
impl Send for MemFiles
impl Sync for MemFiles
impl Unpin for MemFiles
impl UnsafeUnpin for MemFiles
impl UnwindSafe for MemFiles
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