Struct smoltcp::storage::Assembler[][src]

pub struct Assembler { /* fields omitted */ }

A buffer (re)assembler.

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

Implementations

impl Assembler[src]

pub fn new(size: usize) -> Assembler[src]

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

pub fn is_empty(&self) -> bool[src]

Return whether the assembler contains no data.

pub fn add(
    &mut self,
    offset: usize,
    size: usize
) -> Result<(), TooManyHolesError>
[src]

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

pub fn remove_front(&mut self) -> Option<usize>[src]

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

pub fn iter_data(&self, first_offset: usize) -> AssemblerIter<'_>[src]

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

impl Debug for Assembler[src]

impl Display for Assembler[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.