pub struct KeyValueRevision<K: Sized + Copy + Clone, V: Sized + Copy + Clone> { /* private fields */ }Expand description
An in-memory + append-only persistence key-value database with revision history.
Implementations§
Source§impl<K: Ord + Copy + Clone + Serialize + Magic + DeserializeOwned, V: Copy + Clone + Serialize + Magic + DeserializeOwned> KeyValueRevision<K, V>
impl<K: Ord + Copy + Clone + Serialize + Magic + DeserializeOwned, V: Copy + Clone + Serialize + Magic + DeserializeOwned> KeyValueRevision<K, V>
pub async fn try_init( path: impl AsRef<Path>, should_keep_historical_entries_in_memory: bool, ) -> Result<Self, KVRInitializationError>
pub async fn try_insert( &mut self, key: K, value: V, revision: Revision, ) -> Result<(), KVRInsertionError>
pub async fn try_update( &mut self, key: K, value: V, revision: Revision, prev_rev: Revision, ) -> Result<(), KVRUpdateError>
pub fn range<R: RangeBounds<K>>(&self, range: R) -> Range<'_, K, ValueEntry<V>>
Auto Trait Implementations§
impl<K, V> !Freeze for KeyValueRevision<K, V>
impl<K, V> !RefUnwindSafe for KeyValueRevision<K, V>
impl<K, V> Send for KeyValueRevision<K, V>
impl<K, V> Sync for KeyValueRevision<K, V>
impl<K, V> Unpin for KeyValueRevision<K, V>
impl<K, V> !UnwindSafe for KeyValueRevision<K, V>
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