netstack3_core::tcp

Trait ReceiveBuffer

Source
pub trait ReceiveBuffer: Buffer {
    // Required methods
    fn write_at<P>(&mut self, offset: usize, data: &P) -> usize
       where P: Payload;
    fn make_readable(&mut self, count: usize, has_outstanding: bool);
}
Expand description

A buffer supporting TCP receiving operations.

Required Methods§

Source

fn write_at<P>(&mut self, offset: usize, data: &P) -> usize
where P: Payload,

Writes data into the buffer at offset.

Returns the number of bytes written.

Source

fn make_readable(&mut self, count: usize, has_outstanding: bool)

Marks count bytes available for the application to read.

has_outstanding informs the buffer if any bytes past count may have been populated by out of order segments.

§Panics

Panics if the caller attempts to make more bytes readable than the buffer has capacity for. That is, this method panics if self.len() + count > self.cap()

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§