pub struct Snapshot { /* private fields */ }Expand description
A cross-keyspace snapshot
Snapshots keep a consistent view of the database at the time, meaning old data will not be dropped until it is not referenced by any active transaction.
For that reason, you should try to keep transactions short-lived, and make sure they are not held somewhere forever.
Trait Implementations§
Source§impl Readable for Snapshot
impl Readable for Snapshot
Source§fn get<K: AsRef<[u8]>>(
&self,
keyspace: impl AsRef<Keyspace>,
key: K,
) -> Result<Option<UserValue>>
fn get<K: AsRef<[u8]>>( &self, keyspace: impl AsRef<Keyspace>, key: K, ) -> Result<Option<UserValue>>
Retrieves an item from the snapshot. Read more
Source§fn contains_key<K: AsRef<[u8]>>(
&self,
keyspace: impl AsRef<Keyspace>,
key: K,
) -> Result<bool>
fn contains_key<K: AsRef<[u8]>>( &self, keyspace: impl AsRef<Keyspace>, key: K, ) -> Result<bool>
Returns
true if the snapshot contains the specified key. Read moreSource§fn first_key_value(&self, keyspace: impl AsRef<Keyspace>) -> Option<Guard>
fn first_key_value(&self, keyspace: impl AsRef<Keyspace>) -> Option<Guard>
Returns the first key-value pair in the snapshot.
The key in this pair is the minimum key in the snapshot. Read more
Source§fn last_key_value(&self, keyspace: impl AsRef<Keyspace>) -> Option<Guard>
fn last_key_value(&self, keyspace: impl AsRef<Keyspace>) -> Option<Guard>
Returns the last key-value pair in the snapshot.
The key in this pair is the maximum key in the snapshot. Read more
Source§fn size_of<K: AsRef<[u8]>>(
&self,
keyspace: impl AsRef<Keyspace>,
key: K,
) -> Result<Option<u32>>
fn size_of<K: AsRef<[u8]>>( &self, keyspace: impl AsRef<Keyspace>, key: K, ) -> Result<Option<u32>>
Retrieves the size of an item from the snapshot. Read more
Source§fn iter(&self, keyspace: impl AsRef<Keyspace>) -> Iter ⓘ
fn iter(&self, keyspace: impl AsRef<Keyspace>) -> Iter ⓘ
Iterates over the snapshot. Read more
Source§fn range<K: AsRef<[u8]>, R: RangeBounds<K>>(
&self,
keyspace: impl AsRef<Keyspace>,
range: R,
) -> Iter ⓘ
fn range<K: AsRef<[u8]>, R: RangeBounds<K>>( &self, keyspace: impl AsRef<Keyspace>, range: R, ) -> Iter ⓘ
Iterates over a range of the snapshot. Read more
Source§fn prefix<K: AsRef<[u8]>>(
&self,
keyspace: impl AsRef<Keyspace>,
prefix: K,
) -> Iter ⓘ
fn prefix<K: AsRef<[u8]>>( &self, keyspace: impl AsRef<Keyspace>, prefix: K, ) -> Iter ⓘ
Iterates over a prefixed set of the snapshot. Read more
Auto Trait Implementations§
impl Freeze for Snapshot
impl !RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl !UnwindSafe for Snapshot
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