pub struct VersionChain<T> { /* private fields */ }Expand description
Version chain for a single key
Implementations§
Source§impl<T: Clone> VersionChain<T>
impl<T: Clone> VersionChain<T>
pub fn new() -> Self
Sourcepub fn add_version(&mut self, version: VersionedValue<T>)
pub fn add_version(&mut self, version: VersionedValue<T>)
Add a new version (prepends to front as newest)
Sourcepub fn latest(&self) -> Option<&VersionedValue<T>>
pub fn latest(&self) -> Option<&VersionedValue<T>>
Get the latest version
Sourcepub fn version_at(&self, epoch: u64) -> Option<&VersionedValue<T>>
pub fn version_at(&self, epoch: u64) -> Option<&VersionedValue<T>>
Get version visible at specific epoch (strict less-than for consistency with MVCC) Returns None if the key was deleted before the given epoch
Sourcepub fn gc(&mut self, watermark: u64) -> (usize, usize)
pub fn gc(&mut self, watermark: u64) -> (usize, usize)
Clean up versions older than watermark Returns (versions_removed, bytes_freed estimate)
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<T: Debug> Debug for VersionChain<T>
impl<T: Debug> Debug for VersionChain<T>
Auto Trait Implementations§
impl<T> Freeze for VersionChain<T>
impl<T> RefUnwindSafe for VersionChain<T>where
T: RefUnwindSafe,
impl<T> Send for VersionChain<T>where
T: Send,
impl<T> Sync for VersionChain<T>where
T: Sync,
impl<T> Unpin for VersionChain<T>where
T: Unpin,
impl<T> UnsafeUnpin for VersionChain<T>
impl<T> UnwindSafe for VersionChain<T>where
T: 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