[−][src]Struct memofs::VfsLock
Implementations
impl<'_> VfsLock<'_>
[src]
pub fn set_watch_enabled(&mut self, enabled: bool)
[src]
Turns automatic file watching on or off. Enabled by default.
Turning off file watching may be useful for single-use cases, especially on platforms like macOS where registering file watches has significant performance cost.
pub fn read<P: AsRef<Path>>(&mut self, path: P) -> Result<Arc<Vec<u8>>>
[src]
Read a file from the VFS, or the underlying backend if it isn't resident.
Roughly equivalent to std::fs::read
.
pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(
&mut self,
path: P,
contents: C
) -> Result<()>
[src]
&mut self,
path: P,
contents: C
) -> Result<()>
Write a file to the VFS and the underlying backend.
Roughly equivalent to std::fs::write
.
pub fn read_dir<P: AsRef<Path>>(&mut self, path: P) -> Result<ReadDir>
[src]
Read all of the children of a directory.
Roughly equivalent to std::fs::read_dir
.
pub fn remove_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Remove a file.
Roughly equivalent to std::fs::remove_file
.
pub fn remove_dir_all<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Remove a directory and all of its descendants.
Roughly equivalent to std::fs::remove_dir_all
.
pub fn metadata<P: AsRef<Path>>(&mut self, path: P) -> Result<Metadata>
[src]
Query metadata about the given path.
Roughly equivalent to std::fs::metadata
.
pub fn event_receiver(&self) -> Receiver<VfsEvent>
[src]
Retrieve a handle to the event receiver for this Vfs
.
pub fn commit_event(&mut self, event: &VfsEvent) -> Result<()>
[src]
Commit an event to this Vfs
.
Auto Trait Implementations
impl<'a> RefUnwindSafe for VfsLock<'a>
impl<'a> !Send for VfsLock<'a>
impl<'a> !Sync for VfsLock<'a>
impl<'a> Unpin for VfsLock<'a>
impl<'a> UnwindSafe for VfsLock<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,