pub struct RealPersistentCacheIo { /* private fields */ }Expand description
Real implementation of PersistentCacheIo writing to a temp directory.
Each call performs temp write + fsync + rename + parent dir sync, which
is the same crash-safe contract that production code already requires.
Implementations§
Trait Implementations§
Source§impl PersistentCacheIo for RealPersistentCacheIo
impl PersistentCacheIo for RealPersistentCacheIo
Source§fn write_atomic(&self, key: u64, frame: &[u8]) -> Result<(), IoError>
fn write_atomic(&self, key: u64, frame: &[u8]) -> Result<(), IoError>
Atomically write
frame for key (write to temp + fsync + rename +
dir-sync). Errors are reported as IoError.Source§fn remove(&self, key: u64) -> Result<(), IoError>
fn remove(&self, key: u64) -> Result<(), IoError>
Remove the persistent frame for
key, if any. Missing files are OK.Source§fn clear(&self) -> Result<(), IoError>
fn clear(&self) -> Result<(), IoError>
Delete every persistent frame in this cache. Used by
clear.Auto Trait Implementations§
impl Freeze for RealPersistentCacheIo
impl RefUnwindSafe for RealPersistentCacheIo
impl Send for RealPersistentCacheIo
impl Sync for RealPersistentCacheIo
impl Unpin for RealPersistentCacheIo
impl UnsafeUnpin for RealPersistentCacheIo
impl UnwindSafe for RealPersistentCacheIo
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> 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