#[non_exhaustive]
pub enum Event<I: Invocation> {
Init {
status: NodeStatus,
round: RoundNumOf<I>,
state: Option<Arc<FrozenStateOf<I>>>,
},
StatusChange {
old_status: NodeStatus,
new_status: NodeStatus,
},
Activate(RoundNumOf<I>),
Install {
round: RoundNumOf<I>,
state: Option<Arc<FrozenStateOf<I>>>,
},
Commit {
round: RoundNumOf<I>,
log_entry: Arc<LogEntryOf<I>>,
},
Apply {
round: RoundNumOf<I>,
log_entry: Arc<LogEntryOf<I>>,
effect: EffectOf<I>,
new_concurrency: NonZeroUsize,
},
Gaps(Vec<Gap<RoundNumOf<I>>>),
Directive {
kind: DirectiveKind,
leader: NodeOf<I>,
round_num: RoundNumOf<I>,
coord_num: CoordNumOf<I>,
timestamp: Instant,
},
Eject {
reason: EjectionOf<I>,
state: StateOf<I>,
},
}
Expand description
Emitted by Node
’s poll_events
method.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Init
Fields
status: NodeStatus
Initial status of the node.
round: RoundNumOf<I>
Round the node is in.
state: Option<Arc<FrozenStateOf<I>>>
Initial state or None
when no snapshot was given.
First event that is fired immediately after construction.
StatusChange
Node’s status changed.
Activate(RoundNumOf<I>)
The node is transitioning to partially active participation.
Install
Fields
round: RoundNumOf<I>
Round node is in after a snapshot was installed.
state: Option<Arc<FrozenStateOf<I>>>
State the node is in after a snapshot was installed.
A snapshot was installed.
Commit
Fields
round: RoundNumOf<I>
The round for which log_entry
was committed.
log_entry: Arc<LogEntryOf<I>>
The log entry which was committed.
An entry has been committed to the log.
The event does not imply that the entry was applied to the shared state.
Apply
Fields
round: RoundNumOf<I>
Round the log entry was applied in.
log_entry: Arc<LogEntryOf<I>>
Log entry that was applied.
effect: EffectOf<I>
The event data that the application.
new_concurrency: NonZeroUsize
Concurrency after this apply.
The next log entry was applied to the state.
Gaps(Vec<Gap<RoundNumOf<I>>>)
A log entry was queued, preceeding entries are still missing.
Note: This event is emitted even when the queued entry is within the concurrency bound or if this node created the gap itself. The second case can arise when the leader tries to concurrently append multiple entries and abandons some of the earlier appends.
Directive
Fields
kind: DirectiveKind
Kind of directive, either Prepare
, Accept
or Commit
.
leader: NodeOf<I>
Leader that issued the directive.
round_num: RoundNumOf<I>
Round for which the directive was issued.
coord_num: CoordNumOf<I>
Coordination number with which the directive was issued.
timestamp: Instant
Time the directive was (locally) registered.
This node received a (potentially indirect) directive for the given round and from the given node. The node used the mandate obtained with the given coordination number to issue the directive.
This event is not emitted when this node is disoriented or lagging.
Eject
The node ejected its state.
Trait Implementations
sourceimpl<I: Invocation> Debug for Event<I>
impl<I: Invocation> Debug for Event<I>
sourceimpl<I: Invocation> From<Event<I>> for ShutdownEvent<I>
impl<I: Invocation> From<Event<I>> for ShutdownEvent<I>
Auto Trait Implementations
impl<I> RefUnwindSafe for Event<I> where
<I as Invocation>::CoordNum: RefUnwindSafe,
<<I as Invocation>::State as State>::Effect: RefUnwindSafe,
<I as Invocation>::Ejection: RefUnwindSafe,
<<I as Invocation>::State as State>::Frozen: RefUnwindSafe,
<<I as Invocation>::State as State>::LogEntry: RefUnwindSafe,
<<I as Invocation>::State as State>::Node: RefUnwindSafe,
<I as Invocation>::RoundNum: RefUnwindSafe,
<I as Invocation>::State: RefUnwindSafe,
impl<I> Send for Event<I>
impl<I> Sync for Event<I> where
<<I as Invocation>::State as State>::Effect: Sync,
impl<I> Unpin for Event<I> where
<<I as Invocation>::State as State>::Effect: Unpin,
<I as Invocation>::Ejection: Unpin,
<<I as Invocation>::State as State>::Node: Unpin,
<I as Invocation>::State: Unpin,
impl<I> UnwindSafe for Event<I> where
<I as Invocation>::CoordNum: UnwindSafe,
<<I as Invocation>::State as State>::Effect: UnwindSafe,
<I as Invocation>::Ejection: UnwindSafe,
<<I as Invocation>::State as State>::Frozen: RefUnwindSafe,
<<I as Invocation>::State as State>::LogEntry: RefUnwindSafe,
<<I as Invocation>::State as State>::Node: UnwindSafe,
<I as Invocation>::RoundNum: UnwindSafe,
<I as Invocation>::State: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more