pub struct ReliableBroadcast<P: Clone, L: VolatileLink<Data<P>> = PerfectLink<Data<P>>> { /* private fields */ }Expand description
Broadcast with agreement, over best-effort broadcast.
Implementations§
Source§impl<P: Clone> ReliableBroadcast<P, PerfectLink<Data<P>>>
impl<P: Clone> ReliableBroadcast<P, PerfectLink<Data<P>>>
Sourcepub fn new(
me: NodeId,
peers: impl IntoIterator<Item = NodeId>,
interval: Duration,
) -> Self
pub fn new( me: NodeId, peers: impl IntoIterator<Item = NodeId>, interval: Duration, ) -> Self
Reliable broadcast for process me among peers, over links retransmitting every
interval.
Source§impl<P: Clone, L: VolatileLink<Data<P>>> ReliableBroadcast<P, L>
impl<P: Clone, L: VolatileLink<Data<P>>> ReliableBroadcast<P, L>
Sourcepub fn with_link(
me: NodeId,
peers: impl IntoIterator<Item = NodeId>,
link: L,
) -> Self
pub fn with_link( me: NodeId, peers: impl IntoIterator<Item = NodeId>, link: L, ) -> Self
Reliable broadcast for process me among peers, over the link supplied.
Sourcepub fn delivered_count(&self) -> usize
pub fn delivered_count(&self) -> usize
How many distinct broadcasts this process has delivered upward.
Sourcepub fn has_delivered(&self, id: BroadcastId) -> bool
pub fn has_delivered(&self, id: BroadcastId) -> bool
Whether this process has already delivered id.
Trait Implementations§
Source§impl<P: Debug + Clone, L: Debug + VolatileLink<Data<P>>> Debug for ReliableBroadcast<P, L>
impl<P: Debug + Clone, L: Debug + VolatileLink<Data<P>>> Debug for ReliableBroadcast<P, L>
Source§impl<P: Clone, L> Protocol for ReliableBroadcast<P, L>where
L: VolatileLink<Data<P>>,
impl<P: Clone, L> Protocol for ReliableBroadcast<P, L>where
L: VolatileLink<Data<P>>,
Source§type Scope = <L as Protocol>::Scope
type Scope = <L as Protocol>::Scope
Whatever the link’s guarantees are conditional on. RB4 is scoped to the sessions that carried the relay, and this layer cannot bridge one ending.
Source§type Meta = Infallible
type Meta = Infallible
Keeps nothing durably: a crash loses everything this protocol knows.
Source§fn on_scope_event(&mut self, scope: L::Scope, cx: &mut ProtoCx<'_, Self>)
fn on_scope_event(&mut self, scope: L::Scope, cx: &mut ProtoCx<'_, Self>)
Hand the scope ending down. This layer cannot bridge one, and the default would drop it.
Source§type Msg = <BestEffortBroadcast<Data<P>, L> as Protocol>::Msg
type Msg = <BestEffortBroadcast<Data<P>, L> as Protocol>::Msg
What crosses the wire to a peer running the same protocol.
Source§type Entry = Infallible
type Entry = Infallible
The durable entries this protocol appends: what accumulates.
Source§fn on_cmd(&mut self, Cmd::Broadcast: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
fn on_cmd(&mut self, Cmd::Broadcast: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
Handle a request from the layer above.
Source§fn on_msg(&mut self, from: NodeId, msg: Wire<P, L>, cx: &mut ProtoCx<'_, Self>)
fn on_msg(&mut self, from: NodeId, msg: Wire<P, L>, 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
Auto Trait Implementations§
impl<P, L> Freeze for ReliableBroadcast<P, L>where
L: Freeze,
impl<P, L> RefUnwindSafe for ReliableBroadcast<P, L>where
L: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, L> Send for ReliableBroadcast<P, L>
impl<P, L> Sync for ReliableBroadcast<P, L>
impl<P, L> Unpin for ReliableBroadcast<P, L>
impl<P, L> UnsafeUnpin for ReliableBroadcast<P, L>where
L: UnsafeUnpin,
impl<P, L> UnwindSafe for ReliableBroadcast<P, L>where
L: UnwindSafe,
P: 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