pub struct Envelope {
pub v: u32,
pub kind: String,
pub id: String,
pub seq: u64,
pub ts: u64,
pub instance: String,
pub hash: Option<String>,
pub state: Value,
}Expand description
A versioned store record: state is the kind-specific payload; a tombstone
carries state: null.
Fields§
§v: u32§kind: String§id: String§seq: u64§ts: u64Unix ms.
instance: String§hash: Option<String>§state: ValueImplementations§
Source§impl Envelope
impl Envelope
pub fn new( kind: &str, id: &str, seq: u64, instance: &str, hash: Option<String>, state: Value, ) -> Envelope
pub fn is_tombstone(&self) -> bool
pub fn to_value(&self) -> Value
Sourcepub fn from_value(v: Value) -> Result<Envelope, StoreError>
pub fn from_value(v: Value) -> Result<Envelope, StoreError>
Parse a stored value; refuses an unknown envelope major.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Envelope
impl<'de> Deserialize<'de> for Envelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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