pub struct EpochChange { /* private fields */ }Expand description
A sequence of epochs, driven by who is trusted.
Implementations§
Source§impl EpochChange
impl EpochChange
Sourcepub fn new(
me: NodeId,
peers: impl IntoIterator<Item = NodeId>,
timing: Timing,
) -> Self
pub fn new( me: NodeId, peers: impl IntoIterator<Item = NodeId>, timing: Timing, ) -> Self
Epoch-change among peers, over a leader detector with the given heartbeat and timeout and
a best-effort broadcast whose links retransmit every retransmit.
Sourcepub fn last_timestamp(&self) -> u64
pub fn last_timestamp(&self) -> u64
The epoch this process has most recently started, if any.
Trait Implementations§
Source§impl Debug for EpochChange
impl Debug for EpochChange
Source§impl Protocol for EpochChange
impl Protocol for EpochChange
Source§type Meta = Infallible
type Meta = Infallible
Keeps nothing durably. logged_epoch_change is the variant that does.
Source§fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
fn on_init(&mut self, cx: &mut ProtoCx<'_, Self>)
upon event ⟨ ec, Init ⟩ — the state is set in new; this starts the detector, whose first
Trust may immediately make this process announce an epoch.
Source§type Cmd = Infallible
type Cmd = Infallible
Requests from the layer above.
Source§type Scope = Infallible
type Scope = Infallible
Scopes whose boundaries this protocol’s guarantees depend on, and which it can observe. Read more
Source§type Entry = Infallible
type Entry = Infallible
The durable entries this protocol appends: what accumulates.
Source§fn on_cmd(&mut self, cmd: Cmd, _: &mut ProtoCx<'_, Self>)
fn on_cmd(&mut self, cmd: Cmd, _: &mut ProtoCx<'_, Self>)
Handle a request from the layer above.
Source§fn on_msg(&mut self, from: NodeId, msg: Self::Msg, cx: &mut ProtoCx<'_, Self>)
fn on_msg(&mut self, from: NodeId, msg: Self::Msg, cx: &mut ProtoCx<'_, Self>)
Handle a message received from
from.Source§fn on_timer(&mut self, id: TimerId, cx: &mut ProtoCx<'_, Self>)
fn on_timer(&mut self, id: TimerId, cx: &mut ProtoCx<'_, Self>)
Handle a timer that fired somewhere in this protocol or in what it composes. Read more
§fn on_recovery(
&mut self,
_cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>,
)
fn on_recovery( &mut self, _cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>, )
Resume after a crash, reading what survived. Read more
§fn on_scope_event(
&mut self,
_scope: Self::Scope,
_cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>,
)
fn on_scope_event( &mut self, _scope: Self::Scope, _cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>, )
Handle a boundary of a scope this protocol’s guarantees depend on — its end, or the
beginning of the one that succeeds it. Read more
Auto Trait Implementations§
impl Freeze for EpochChange
impl RefUnwindSafe for EpochChange
impl Send for EpochChange
impl Sync for EpochChange
impl Unpin for EpochChange
impl UnsafeUnpin for EpochChange
impl UnwindSafe for EpochChange
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