pub struct PersistentMap { /* private fields */ }Expand description
A persistent-style map that supports snapshotting.
Implementations§
Source§impl PersistentMap
impl PersistentMap
pub fn new() -> Self
pub fn insert(&mut self, key: &str, value: &str)
pub fn get(&self, key: &str) -> Option<&str>
pub fn remove(&mut self, key: &str) -> bool
pub fn contains(&self, key: &str) -> bool
pub fn snapshot(&mut self)
pub fn restore(&mut self, idx: usize) -> bool
pub fn snapshot_count(&self) -> usize
pub fn version(&self) -> u64
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
pub fn keys(&self) -> Vec<&str>
pub fn diff_from_snapshot(&self, idx: usize) -> Vec<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PersistentMap
impl RefUnwindSafe for PersistentMap
impl Send for PersistentMap
impl Sync for PersistentMap
impl Unpin for PersistentMap
impl UnsafeUnpin for PersistentMap
impl UnwindSafe for PersistentMap
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