pub struct ReliableEndpoint { /* private fields */ }Expand description
The reliable channel to a single peer. Pure: drive it with send, on_datagram, and on_tick,
moving the returned frames over the mesh yourself.
Implementations§
Source§impl ReliableEndpoint
impl ReliableEndpoint
Sourcepub fn new(rto_ms: u64, max_attempts: u32) -> ReliableEndpoint
pub fn new(rto_ms: u64, max_attempts: u32) -> ReliableEndpoint
A channel with explicit retransmit timeout and attempt cap.
Sourcepub fn send(&mut self, payload: &[u8], now_ms: u64) -> Vec<u8> ⓘ
pub fn send(&mut self, payload: &[u8], now_ms: u64) -> Vec<u8> ⓘ
Queue payload for reliable delivery and return the DATA frame to send now. The frame is
buffered for retransmission until the peer acknowledges it (see on_tick).
Sourcepub fn on_datagram(&mut self, frame: &[u8], _now_ms: u64) -> Inbound
pub fn on_datagram(&mut self, frame: &[u8], _now_ms: u64) -> Inbound
Process one inbound wire frame. A DATA frame is deduplicated and (if new) its payload is delivered; either way an ACK is returned so the sender stops retransmitting. An ACK frame clears the matching unacked datagram. Malformed frames are ignored.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReliableEndpoint
impl RefUnwindSafe for ReliableEndpoint
impl Send for ReliableEndpoint
impl Sync for ReliableEndpoint
impl Unpin for ReliableEndpoint
impl UnsafeUnpin for ReliableEndpoint
impl UnwindSafe for ReliableEndpoint
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.