Skip to main content

Reassembler

Struct Reassembler 

Source
pub struct Reassembler { /* private fields */ }
Expand description

The incomplete samples of one writer.

Implementations§

Source§

impl Reassembler

Source

pub fn new(limits: ReassemblyLimits, keep: Keep) -> Self

An empty reassembler.

Source

pub fn add( &mut self, writer: Guid, d: &DataFrag, timestamp: Option<Time>, ) -> Option<Change>

Adds the fragments in d (from writer) and returns the change once all of its fragments are in. Fragments of a sample larger than the limit, or that disagree with earlier fragments of the same sample on its size or fragment size, are dropped.

Source

pub fn contains(&self, sn: SequenceNumber) -> bool

Whether some fragments of sn are in, but not all.

Source

pub fn remove(&mut self, sn: SequenceNumber)

Drops the incomplete sample sn.

Source

pub fn retain(&mut self, f: impl FnMut(SequenceNumber) -> bool)

Keeps only the incomplete samples for which f is true.

Source

pub fn incomplete(&self) -> impl Iterator<Item = SequenceNumber> + '_

The incomplete samples, in order.

Source

pub fn is_empty(&self) -> bool

Whether no sample is incomplete.

Source

pub fn missing( &self, sn: SequenceNumber, last: Option<FragmentNumber>, ) -> Option<FragmentNumberSet>

The fragments of sn still missing, up to last (all when None), for a NACK_FRAG: at most 256 numbers from the first missing one. None when nothing of sn is in, or nothing is missing up to last.

Trait Implementations§

Source§

impl Debug for Reassembler

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.