pub struct Event {
pub time: Hlc,
pub seq: u64,
pub prev: Option<EventHash>,
pub payload: Payload,
}Expand description
One event: who wrote it when, its place in the device’s chain, and what happened. An event is always a root
object: {"type": "event", "kind": …, "time": …, "seq": …, "prev": …, …}.
Fields§
§time: HlcThe timestamp; its device is the device that wrote the event.
seq: u64Position in the device’s chain, starting at 1.
prev: Option<EventHash>The hash of the device’s previous event; none for seq 1.
payload: PayloadWhat happened: kind and its members.
Implementations§
Source§impl Event
impl Event
Sourcepub fn hash(&self) -> EventHash
pub fn hash(&self) -> EventHash
The identity of an event written on this device: SHA-256 over its canonical encoding (spec part 0003).
A received event is identified by what was received, which may hold members this version does not know –
use the hash EventSet::receive returns. An event built in code must keep its integers at or below
2^53 − 1.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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 Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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