pub struct ReaderSlot { /* private fields */ }Expand description
Held by a snapshot reader for its lifetime; the registration disappears (unlink + lock release) on drop, and the LOCK disappears even on crash.
Implementations§
Source§impl ReaderSlot
impl ReaderSlot
Sourcepub fn register(db: &Path, gen: u64) -> Result<ReaderSlot>
pub fn register(db: &Path, gen: u64) -> Result<ReaderSlot>
Register a reader pinned at gen. Failure to register is returned as
an error: an unregistered reader is exactly the unsafe state.
Sourcepub fn set_generation(&mut self, generation: u64) -> Result<()>
pub fn set_generation(&mut self, generation: u64) -> Result<()>
Replace a conservative generation-zero reservation with the generation selected from metadata. While the two framed copies are being changed, a writer sees either 0, the final generation, or a mismatch that also decodes as 0. Every intermediate state therefore stops recycling.
Trait Implementations§
Source§impl Drop for ReaderSlot
impl Drop for ReaderSlot
Auto Trait Implementations§
impl Freeze for ReaderSlot
impl RefUnwindSafe for ReaderSlot
impl Send for ReaderSlot
impl Sync for ReaderSlot
impl Unpin for ReaderSlot
impl UnsafeUnpin for ReaderSlot
impl UnwindSafe for ReaderSlot
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