pub struct OsFs;Expand description
The operating system’s filesystem. No test can see whether a sync reached the disk without cutting power, so Store’s crash tests use the crash filesystem’s model of syncing instead.
Trait Implementations§
impl Copy for OsFs
Source§impl Fs for OsFs
impl Fs for OsFs
Source§fn write_new(&self, path: &Path, data: &[u8]) -> Result<()>
fn write_new(&self, path: &Path, data: &[u8]) -> Result<()>
Creates a file that must not exist yet and writes
data to it,
without syncing. Read moreSource§fn rename(&self, from: &Path, to: &Path) -> Result<()>
fn rename(&self, from: &Path, to: &Path) -> Result<()>
Renames a file, replacing any file at
to. Read moreSource§fn rename_new(&self, from: &Path, to: &Path) -> Result<()>
fn rename_new(&self, from: &Path, to: &Path) -> Result<()>
Renames a file only if nothing has the name
to, in one step: of
two callers renaming onto one name, one is refused. Read moreSource§fn sync_dir(&self, dir: &Path) -> Result<()>
fn sync_dir(&self, dir: &Path) -> Result<()>
Makes a directory’s entries durable: files created, renamed or
removed in it. Read more
Source§fn list(&self, dir: &Path) -> Result<Vec<OsString>>
fn list(&self, dir: &Path) -> Result<Vec<OsString>>
The names in a directory, sorted. Read more
Source§fn create_dir_all(&self, dir: &Path) -> Result<()>
fn create_dir_all(&self, dir: &Path) -> Result<()>
Creates a directory and its parents, without syncing. A new
directory survives a crash once the directory holding it is synced. Read more
Source§fn remove_dir_all(&self, dir: &Path) -> Result<()>
fn remove_dir_all(&self, dir: &Path) -> Result<()>
Removes a directory and everything in it, without syncing. The
removal survives a crash once the directory that held it is synced. Read more
Source§fn open_for_sync(&self, path: &Path) -> Result<Box<dyn SyncHandle>>
fn open_for_sync(&self, path: &Path) -> Result<Box<dyn SyncHandle>>
Opens an existing file, to make its data durable later through the
handle, as often as needed. Linux reports a failed writeback to each
file open at the time, once: a file opened after the failure does not
see it, so a file that must see every failure is opened once, before
the writes, and kept open. Read more
Auto Trait Implementations§
impl Forget for OsFs
impl Freeze for OsFs
impl Move for OsFs
impl RefUnwindSafe for OsFs
impl Send for OsFs
impl Sync for OsFs
impl Unpin for OsFs
impl UnsafeUnpin for OsFs
impl UnwindSafe for OsFs
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.