[][src]Struct rdms::mvcc::MvccWriter

pub struct MvccWriter<K, V> where
    K: Clone + Ord,
    V: Clone + Diff
{ /* fields omitted */ }

Write handle into Mvcc index, that implements both Send and Sync.

Trait Implementations

impl<K, V> Writer<K, V> for MvccWriter<K, V> where
    K: Clone + Ord + Footprint,
    V: Clone + Diff + Footprint
[src]

fn set(&mut self, key: K, value: V) -> Result<Option<Entry<K, V>>>[src]

Set {key, value} pair into index. If key is already present, update the value and return the previous entry, else create a new entry.

LSM mode: Add a new version for the key, perserving the old value.

fn set_cas(&mut self, key: K, value: V, cas: u64) -> Result<Option<Entry<K, V>>>[src]

Similar to set, but succeeds only when CAS matches with entry's last seqno. In other words, since seqno is unique to each mutation, we use seqno of the mutation as the CAS value. Use CAS == 0 to enforce a create operation.

LSM mode: Add a new version for the key, perserving the old value.

fn delete<Q: ?Sized>(&mut self, key: &Q) -> Result<Option<Entry<K, V>>> where
    K: Borrow<Q>,
    Q: ToOwned<Owned = K> + Ord
[src]

Delete the given key. Note that back-to-back delete for the same key shall collapse into a single delete, first delete is ingested while the rest are ignored.

LSM mode: Mark the entry as deleted along with seqno at which it deleted

NOTE: K should be borrowable as &Q and Q must be convertable to owned K. This is require in lsm mode, where owned K must be inserted into the tree.

impl<K, V> Drop for MvccWriter<K, V> where
    K: Clone + Ord,
    V: Clone + Diff
[src]

impl<K, V> AsMut<Mvcc<K, V>> for MvccWriter<K, V> where
    K: Clone + Ord,
    V: Clone + Diff
[src]

Auto Trait Implementations

impl<K, V> Send for MvccWriter<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for MvccWriter<K, V> where
    K: Sync,
    V: Sync

impl<K, V> Unpin for MvccWriter<K, V> where
    K: Unpin,
    V: Unpin

impl<K, V> UnwindSafe for MvccWriter<K, V> where
    K: UnwindSafe,
    V: UnwindSafe

impl<K, V> RefUnwindSafe for MvccWriter<K, V> where
    K: RefUnwindSafe,
    V: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]