pub struct PerfectLink<P> { /* private fields */ }Expand description
Reliable delivery, exactly once, over a stubborn link.
Implementations§
Source§impl<P> PerfectLink<P>
impl<P> PerfectLink<P>
Sourcepub fn new(me: NodeId, interval: Duration) -> Self
pub fn new(me: NodeId, interval: Duration) -> Self
A perfect link for process me, retransmitting every interval underneath.
Sourcepub fn delivered_count(&self) -> usize
pub fn delivered_count(&self) -> usize
How many distinct messages have been delivered upward.
Sourcepub fn outstanding(&self) -> usize
pub fn outstanding(&self) -> usize
How many transmissions the layer below is still retrying.
Trait Implementations§
Source§impl<P: Debug> Debug for PerfectLink<P>
impl<P: Debug> Debug for PerfectLink<P>
Source§impl<P> Link<P> for PerfectLink<P>where
P: Clone,
The perfect link satisfies the link port, and reports no scope boundary.
impl<P> Link<P> for PerfectLink<P>where
P: Clone,
The perfect link satisfies the link port, and reports no scope boundary.
Link::classify here never yields
LinkInd::Boundary: PL2’s no-duplication holds within one
incarnation of the recipient, and this link has no means of observing that incarnation ending. A
link that reported a boundary it cannot see would be asserting something it does not know, which
docs/scope-annotated-modules.md forbids by Definition 2a.
Nothing in the type system enforces that, and crate::link records why: a ScopedLink
marker trait existed for exactly this and was deleted for want of a consumer — the one layer
that should have bounded on it could not, because its resend lives in the Link impl and the
tighter bound would have fallen on every link. What keeps it honest instead is the
classification itself, and tests/link_port.rs pins both halves: that this link’s
classification never yields a boundary, and that the session link’s yields one for each variant
that reports it.
Source§impl<P: Clone> Protocol for PerfectLink<P>
impl<P: Clone> Protocol for PerfectLink<P>
Source§type Scope = Infallible
type Scope = Infallible
No scope conditions: this protocol’s guarantees do not lapse.
Source§type Meta = Infallible
type Meta = Infallible
Keeps nothing durably: a crash loses everything this protocol knows.
Source§type Entry = Infallible
type Entry = Infallible
Source§fn on_cmd(&mut self, _: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
fn on_cmd(&mut self, _: Cmd<P>, cx: &mut ProtoCx<'_, Self>)
Source§fn on_msg(&mut self, from: NodeId, msg: Wire<P>, cx: &mut ProtoCx<'_, Self>)
fn on_msg(&mut self, from: NodeId, msg: Wire<P>, cx: &mut ProtoCx<'_, Self>)
from.