pub struct ReliableDataInputChannel { /* private fields */ }Expand description
Handles reliable data packets, extracting the proxied application data in order.
Implementations§
Source§impl ReliableDataInputChannel
impl ReliableDataInputChannel
Sourcepub fn new(
config: InputConfig,
cipher: Option<Rc4KeyState>,
now: Instant,
) -> Self
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.
Sourcepub fn stats(&self) -> &DataInputStats
pub fn stats(&self) -> &DataInputStats
Returns the gathered input statistics.
Sourcepub fn take_outgoing(&mut self) -> Vec<OutgoingContextual>
pub fn take_outgoing(&mut self) -> Vec<OutgoingContextual>
Drains the outgoing acknowledgement packets accumulated so far.
Sourcepub fn take_app_data(&mut self) -> Vec<Bytes>
pub fn take_app_data(&mut self) -> Vec<Bytes>
Drains the decoded application data buffers accumulated so far.
Sourcepub fn run_tick(&mut self, now: Instant)
pub fn run_tick(&mut self, now: Instant)
Runs periodic channel logic: emits a buffered AcknowledgeAll when due.
Sourcepub fn handle_reliable_data(
&mut self,
data: Bytes,
now: Instant,
) -> Result<(), CorruptData>
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.
Sourcepub fn handle_reliable_data_fragment(
&mut self,
data: Bytes,
now: Instant,
) -> Result<(), CorruptData>
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.