Struct Entry

Source
pub struct Entry<K, V, D = NoDiff> {
    pub key: K,
    pub value: Value<V>,
    pub deltas: Vec<Delta<D>>,
}
Expand description

Entry type, describe a single {key,value} entry within indexed data-set.

Fields§

§key: K§value: Value<V>§deltas: Vec<Delta<D>>

Implementations§

Source§

impl<K, V, D> Entry<K, V, D>

Source

pub const ID: u32 = 1u32

Source§

impl<K, V, D> Entry<K, V, D>

Source

pub fn new(key: K, value: V, seqno: u64) -> Entry<K, V, D>

Source

pub fn new_deleted(key: K, seqno: u64) -> Entry<K, V, D>

Source

pub fn insert(&mut self, value: V, seqn: u64)
where V: Clone + Diff<Delta = D>,

Source

pub fn delete(&mut self, seqn: u64)
where V: Clone + Diff<Delta = D>, <V as Diff>::Delta: From<V>,

Source

pub fn drain_deltas(&mut self)

Source§

impl<K, V, D> Entry<K, V, D>

Source

pub fn to_seqno(&self) -> u64

Source

pub fn to_key(&self) -> K
where K: Clone,

Source

pub fn to_value(&self) -> Option<V>
where V: Clone,

Source

pub fn as_key(&self) -> &K

Source

pub fn borrow_key<Q>(&self) -> &Q
where K: Borrow<Q>,

Source

pub fn is_deleted(&self) -> bool

Source

pub fn to_values(&self) -> Vec<Value<V>>
where V: Diff<Delta = D> + Clone, D: Clone,

Source

pub fn contains(&self, other: &Self) -> bool
where V: Clone + PartialEq + Diff<Delta = D>, D: Clone,

Source

pub fn merge(&self, other: &Self) -> Self
where K: PartialEq + Clone, V: Clone + Diff<Delta = D>, D: Clone + From<V>,

Source

pub fn purge(self, cutoff: Cutoff) -> Option<Self>
where Self: Sized,

Trait Implementations§

Source§

impl<K: Clone, V: Clone, D: Clone> Clone for Entry<K, V, D>

Source§

fn clone(&self) -> Entry<K, V, D>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K: Debug, V: Debug, D: Debug> Debug for Entry<K, V, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K, V, D> From<(K, Vec<Value<V>>)> for Entry<K, V, D>
where V: Clone + Diff<Delta = D>, <V as Diff>::Delta: From<V>,

Source§

fn from((key, values): (K, Vec<Value<V>>)) -> Self

Converts to this type from the input type.
Source§

impl<K, V, D> FromCbor for Entry<K, V, D>
where K: FromCbor, V: FromCbor, D: FromCbor,

Source§

fn from_cbor(value: Cbor) -> Result<Entry<K, V, D>>

Convert value from Cbor into type’s value.
Source§

impl<K, V, D> IntoCbor for Entry<K, V, D>
where K: IntoCbor, V: IntoCbor, D: IntoCbor,

Source§

fn into_cbor(self) -> Result<Cbor>

Convert implementing type’s value into Cbor.
Source§

impl<K: PartialEq, V: PartialEq, D: PartialEq> PartialEq for Entry<K, V, D>

Source§

fn eq(&self, other: &Entry<K, V, D>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<K: Eq, V: Eq, D: Eq> Eq for Entry<K, V, D>

Source§

impl<K, V, D> StructuralPartialEq for Entry<K, V, D>

Auto Trait Implementations§

§

impl<K, V, D> Freeze for Entry<K, V, D>
where K: Freeze, V: Freeze,

§

impl<K, V, D> RefUnwindSafe for Entry<K, V, D>

§

impl<K, V, D> Send for Entry<K, V, D>
where K: Send, V: Send, D: Send,

§

impl<K, V, D> Sync for Entry<K, V, D>
where K: Sync, V: Sync, D: Sync,

§

impl<K, V, D> Unpin for Entry<K, V, D>
where K: Unpin, V: Unpin, D: Unpin,

§

impl<K, V, D> UnwindSafe for Entry<K, V, D>
where K: UnwindSafe, V: UnwindSafe, D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.