[−][src]Struct smoltcp::storage::Assembler
A buffer (re)assembler.
Currently, up to a hardcoded limit of 4 or 32 holes can be tracked in the buffer.
Methods
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<(), ()>
[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<'a>(&'a self, first_offset: usize) -> AssemblerIter<'a>
[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
Auto Trait Implementations
impl RefUnwindSafe for Assembler
impl Send for Assembler
impl Sync for Assembler
impl Unpin for Assembler
impl UnwindSafe for Assembler
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,