pub struct ReliableClientSender { /* private fields */ }Expand description
Bounded reliable client sender state.
Implementations§
Source§impl ReliableClientSender
impl ReliableClientSender
Sourcepub fn new(config: ReliableClientConfig) -> Self
pub fn new(config: ReliableClientConfig) -> Self
Creates a reliable client sender.
Sourcepub const fn config(&self) -> ReliableClientConfig
pub const fn config(&self) -> ReliableClientConfig
Returns sender configuration.
Sourcepub const fn stats(&self) -> ReliableClientStats
pub const fn stats(&self) -> ReliableClientStats
Returns sender statistics.
Sourcepub fn in_flight_len(&self) -> usize
pub fn in_flight_len(&self) -> usize
Returns total in-flight reliable packets.
Sourcepub fn in_flight_for(&self, peer_client: ClientId) -> usize
pub fn in_flight_for(&self, peer_client: ClientId) -> usize
Returns in-flight reliable packets for one peer client.
Sourcepub fn send<T: TransportSink>(
&mut self,
transport: &mut T,
packet: OutboundPacket,
now_tick: u64,
) -> Result<u64, ReliableClientError<T::Error>>
pub fn send<T: TransportSink>( &mut self, transport: &mut T, packet: OutboundPacket, now_tick: u64, ) -> Result<u64, ReliableClientError<T::Error>>
Sends a new reliable packet and stores it until acknowledged or timed out.
Sourcepub fn acknowledge(
&mut self,
ack_source_client: ClientId,
sequence: u64,
) -> bool
pub fn acknowledge( &mut self, ack_source_client: ClientId, sequence: u64, ) -> bool
Processes an ACK from ack_source_client.
Sourcepub fn retry_due_into<T: TransportSink>(
&mut self,
transport: &mut T,
now_tick: u64,
scratch: &mut ReliableClientRetryScratch,
) -> Result<ReliableRetryReport, ReliableClientError<T::Error>>
pub fn retry_due_into<T: TransportSink>( &mut self, transport: &mut T, now_tick: u64, scratch: &mut ReliableClientRetryScratch, ) -> Result<ReliableRetryReport, ReliableClientError<T::Error>>
Retries due packets using caller-owned scan storage.
Trait Implementations§
Source§impl Clone for ReliableClientSender
impl Clone for ReliableClientSender
Source§fn clone(&self) -> ReliableClientSender
fn clone(&self) -> ReliableClientSender
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReliableClientSender
impl Debug for ReliableClientSender
Auto Trait Implementations§
impl Freeze for ReliableClientSender
impl RefUnwindSafe for ReliableClientSender
impl Send for ReliableClientSender
impl Sync for ReliableClientSender
impl Unpin for ReliableClientSender
impl UnsafeUnpin for ReliableClientSender
impl UnwindSafe for ReliableClientSender
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