pub struct Event {
pub id: EventId,
pub event_type: EventType,
pub source: NodeId,
pub target_state: StateId,
pub version_ref: VersionVector,
pub mutation: MutationOp,
pub time_intent: TimeIntent,
pub authority_proof: AuthorityProof,
pub entropy_hint: EntropyHint,
}Expand description
Event - a lawful mutation of state
Fields§
§id: EventIdEvent identity (for causal ordering)
event_type: EventTypeEvent type
source: NodeIdSource node identity
target_state: StateIdTarget state atom
version_ref: VersionVectorExpected version before mutation
mutation: MutationOpThe mutation operation
time_intent: TimeIntentTemporal intent
Authority proof
entropy_hint: EntropyHintEntropy hint
Implementations§
Source§impl Event
impl Event
Sourcepub fn new(
source: NodeId,
seq: u64,
event_type: EventType,
target_state: StateId,
mutation: MutationOp,
) -> Self
pub fn new( source: NodeId, seq: u64, event_type: EventType, target_state: StateId, mutation: MutationOp, ) -> Self
Create a new event
Sourcepub fn with_version(self, version: VersionVector) -> Self
pub fn with_version(self, version: VersionVector) -> Self
Set version reference
Sourcepub fn with_time_intent(self, intent: TimeIntent) -> Self
pub fn with_time_intent(self, intent: TimeIntent) -> Self
Set time intent
Set authority proof
Sourcepub fn with_entropy_hint(self, hint: EntropyHint) -> Self
pub fn with_entropy_hint(self, hint: EntropyHint) -> Self
Set entropy hint
Sourcepub fn absolute_time(&self, reference: StateTime) -> StateTime
pub fn absolute_time(&self, reference: StateTime) -> StateTime
Get the absolute time intent given a reference
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin 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