pub struct Store<B> { /* private fields */ }Expand description
Node values under their keys: a render stages, and only persist commits each value whole
by rename, evicting the least recently used past the budget. Every change to the backend’s
names runs under its lock; lookups and reads never wait on it.
Implementations§
Source§impl<B: Backend> Store<B>
impl<B: Backend> Store<B>
Sourcepub async fn open(backend: B, max_bytes: u64) -> Result<Store<B>, String>
pub async fn open(backend: B, max_bytes: u64) -> Result<Store<B>, String>
A store of another format is emptied first.
pub fn max_bytes(&self) -> u64
pub fn bytes(&self) -> u64
pub fn holds(&self, key: Hash) -> bool
Sourcepub async fn persist(&self) -> Result<Persisted, String>
pub async fn persist(&self) -> Result<Persisted, String>
A value staged without its meta is dropped. A key leaves the staging record only once its files have, so a failed write leaves every later one staged, as does a commit over an open entry. An open entry past budget stays for the next persist.
Trait Implementations§
Auto Trait Implementations§
impl<B> !Freeze for Store<B>
impl<B> RefUnwindSafe for Store<B>where
B: RefUnwindSafe,
impl<B> Send for Store<B>where
B: Send,
impl<B> Sync for Store<B>where
B: Sync,
impl<B> Unpin for Store<B>where
B: Unpin,
impl<B> UnsafeUnpin for Store<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for Store<B>where
B: UnwindSafe,
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