pub struct SeqV<M, T = Vec<u8>> {
pub seq: u64,
pub meta: Option<M>,
pub data: T,
}Expand description
Some value bound with a seq number.
SeqV is the meta-service API level generic value.
Meta-service application uses this type to interact with meta-service.
Inside the meta-service, the value is stored in the form of Marked, which could be a
tombstone. A Marked::TombStone is converted to None::<SeqV> and a Marked::Normal is
converted to Some::<SeqV>.
A Marked::TombStone also has an internal_seq, representing the freshness of the tombstone.
internal_seq will be discarded when Marked::TombStone is converted to None::<SeqV>.
Fields§
§seq: u64§meta: Option<M>§data: TImplementations§
Source§impl<M, T> SeqV<M, T>
impl<M, T> SeqV<M, T>
pub fn new(seq: u64, data: T) -> Self
pub fn new_with_meta(seq: u64, meta: Option<M>, data: T) -> Self
pub fn with_seq(self, seq: u64) -> Self
pub fn with_meta(self, m: Option<M>) -> Self
pub fn with_value(self, v: T) -> Self
Trait Implementations§
Source§impl<M, V> SeqValue<M, V> for SeqV<M, V>
impl<M, V> SeqValue<M, V> for SeqV<M, V>
Source§fn into_value(self) -> Option<V>
fn into_value(self) -> Option<V>
Consume the value and return the value.
Source§fn unpack(self) -> (u64, Option<V>)where
Self: Sized,
fn unpack(self) -> (u64, Option<V>)where
Self: Sized,
Consume self and return the sequence number and the value.
Source§fn expires_at_ms_opt(&self) -> Option<u64>where
M: Expirable,
fn expires_at_ms_opt(&self) -> Option<u64>where
M: Expirable,
Return the absolute expire time in millisecond since 1970-01-01 00:00:00.
impl<M: Eq, T: Eq> Eq for SeqV<M, T>
impl<M, T> StructuralPartialEq for SeqV<M, T>
Auto Trait Implementations§
impl<M, T> Freeze for SeqV<M, T>
impl<M, T> RefUnwindSafe for SeqV<M, T>where
T: RefUnwindSafe,
M: RefUnwindSafe,
impl<M, T> Send for SeqV<M, T>
impl<M, T> Sync for SeqV<M, T>
impl<M, T> Unpin for SeqV<M, T>
impl<M, T> UnwindSafe for SeqV<M, T>where
T: UnwindSafe,
M: UnwindSafe,
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