pub struct StubbornBroadcast<P: Clone> { /* private fields */ }Expand description
Fan-out that never gives up.
Implementations§
Source§impl<P: Clone> StubbornBroadcast<P>
impl<P: Clone> StubbornBroadcast<P>
Sourcepub fn new(
me: NodeId,
members: impl IntoIterator<Item = NodeId>,
interval: Duration,
) -> Self
pub fn new( me: NodeId, members: impl IntoIterator<Item = NodeId>, interval: Duration, ) -> Self
Broadcast among members, which must include me, retransmitting every interval.
Sourcepub fn peers(&self) -> impl Iterator<Item = NodeId> + '_
pub fn peers(&self) -> impl Iterator<Item = NodeId> + '_
The process set. This layer’s whole state, besides what is still being transmitted.
Sourcepub fn outstanding_count(&self) -> usize
pub fn outstanding_count(&self) -> usize
How many broadcasts are still being retransmitted. Nothing retires one but Cmd::Stop.
Trait Implementations§
Source§impl<P: Clone> Protocol for StubbornBroadcast<P>
impl<P: Clone> Protocol for StubbornBroadcast<P>
Source§type Meta = Infallible
type Meta = Infallible
Keeps nothing durably: what it is transmitting is rebuilt by the layer above on recovery.
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<P>, cx: &mut ProtoCx<'_, Self>)
fn on_cmd(&mut self, cmd: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
Handle a request from the layer above.
Source§fn on_msg(&mut self, from: NodeId, msg: P, cx: &mut ProtoCx<'_, Self>)
fn on_msg(&mut self, from: NodeId, msg: P, 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_init(
&mut self,
_cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>,
)
fn on_init( &mut self, _cx: &mut Cx<'_, Self::Msg, Self::Ind, Self::Note, Self::Meta, Self::Entry>, )
Begin, on a first start — when nothing has been written down. 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<P> Freeze for StubbornBroadcast<P>
impl<P> RefUnwindSafe for StubbornBroadcast<P>where
P: RefUnwindSafe,
impl<P> Send for StubbornBroadcast<P>where
P: Send,
impl<P> Sync for StubbornBroadcast<P>where
P: Sync,
impl<P> Unpin for StubbornBroadcast<P>where
P: Unpin,
impl<P> UnsafeUnpin for StubbornBroadcast<P>
impl<P> UnwindSafe for StubbornBroadcast<P>where
P: RefUnwindSafe + UnwindSafe,
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