Struct smoltcp::storage::Assembler

source ·
pub struct Assembler { /* private fields */ }
Expand description

A buffer (re)assembler.

Currently, up to a hardcoded limit of 4 or 32 holes can be tracked in the buffer.

Implementations§

Create a new buffer assembler for buffers of the given size.

Return whether the assembler contains no data.

Add a new contiguous range to the assembler, and return Ok(()), or return Err(()) if too many discontiguities are already recorded.

Remove a contiguous range from the front of the assembler and Some(data_size), or return None if there is no such range.

Iterate over all of the contiguous data ranges.

This is used in calculating what data ranges have been received. The offset indicates the number of bytes of contiguous data received before the beginnings of this Assembler.

Data Hole Data |— 100 —|— 200 —|— 100 —|

An offset of 1500 would return the ranges: (1500, 1600), (1800, 1900)

Trait Implementations§

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.