Skip to main content

ReliableDataInputChannel

Struct ReliableDataInputChannel 

Source
pub struct ReliableDataInputChannel { /* private fields */ }
Expand description

Handles reliable data packets, extracting the proxied application data in order.

Implementations§

Source§

impl ReliableDataInputChannel

Source

pub fn new( config: InputConfig, cipher: Option<Rc4KeyState>, now: Instant, ) -> Self

Creates a new input channel. cipher is the initial RC4 key state; pass Some(..) to enable RC4 decryption of the proxied application data, or None to pass it through unencrypted.

Source

pub fn stats(&self) -> &DataInputStats

Returns the gathered input statistics.

Source

pub fn take_outgoing(&mut self) -> Vec<OutgoingContextual>

Drains the outgoing acknowledgement packets accumulated so far.

Source

pub fn take_app_data(&mut self) -> Vec<Bytes>

Drains the decoded application data buffers accumulated so far.

Source

pub fn run_tick(&mut self, now: Instant)

Runs periodic channel logic: emits a buffered AcknowledgeAll when due.

Source

pub fn handle_reliable_data( &mut self, data: Bytes, now: Instant, ) -> Result<(), CorruptData>

Handles a OpCode::ReliableData packet (OP code already stripped). Returns Err if the data (or any stashed fragment it releases) is malformed.

Source

pub fn handle_reliable_data_fragment( &mut self, data: Bytes, now: Instant, ) -> Result<(), CorruptData>

Handles a OpCode::ReliableDataFragment packet (OP code already stripped). Returns Err if the fragment (or any stashed fragment it releases) is malformed.

Trait Implementations§

Source§

impl Debug for ReliableDataInputChannel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.