pub struct Event {
pub id: CorrelationId,
pub timestamp: Timestamp,
pub event_type: EventType,
pub payload: Vec<u8>,
pub source_did: Did,
pub signature: Signature,
}Expand description
A signed, timestamped event in the EXOCHAIN system.
Fields§
§id: CorrelationIdUnique identifier for this event.
timestamp: TimestampHLC timestamp of when the event was created.
event_type: EventTypeClassification of the event.
payload: Vec<u8>CBOR-encoded payload (opaque bytes).
source_did: DidDID of the entity that produced the event.
signature: SignatureEd25519 signature over the canonical event content.
Implementations§
Source§impl Event
impl Event
Sourcepub fn write_signable_bytes<W: Write>(&self, writer: W) -> Result<()>
pub fn write_signable_bytes<W: Write>(&self, writer: W) -> Result<()>
Construct the canonical bytes that are signed.
The signed content is a domain-separated, schema-versioned CBOR
envelope over id, timestamp, event_type, payload, and
source_did.
§Errors
Returns ExoError::SerializationError if CBOR encoding fails.
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