pub struct Reassembler { /* private fields */ }Implementations§
Source§impl Reassembler
impl Reassembler
Sourcepub fn new() -> Self
pub fn new() -> Self
Holds up to DEFAULT_MAX_PENDING incomplete messages.
Sourcepub fn with_max_pending(max: usize) -> Self
pub fn with_max_pending(max: usize) -> Self
Holds up to max incomplete messages (at least 1).
Sourcepub fn max_pending(&self) -> usize
pub fn max_pending(&self) -> usize
The cap on incomplete messages.
Sourcepub fn push(
&mut self,
key: Key,
seq: u8,
fragment: Fragment,
now: u64,
) -> Option<Message>
pub fn push( &mut self, key: Key, seq: u8, fragment: Fragment, now: u64, ) -> Option<Message>
Add part seq (1-based) of key. Returns the message once every part is in.
A repeated seq replaces the earlier copy; seq outside 1..=total is ignored.
A part of a new message when Self::max_pending are held evicts the oldest.
Sourcepub fn push_tpdu(&mut self, tpdu: &Tpdu, now: u64) -> Option<Message>
pub fn push_tpdu(&mut self, tpdu: &Tpdu, now: u64) -> Option<Message>
Feed a decoded TPDU. Messages without a valid concatenation IE complete at once.
Sourcepub fn expire_before(&mut self, cutoff: u64) -> Vec<Key>
pub fn expire_before(&mut self, cutoff: u64) -> Vec<Key>
Drop incomplete messages whose newest part arrived before cutoff; returns
their keys.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Reassembler
impl Freeze for Reassembler
impl RefUnwindSafe for Reassembler
impl Send for Reassembler
impl Sync for Reassembler
impl Unpin for Reassembler
impl UnsafeUnpin for Reassembler
impl UnwindSafe for Reassembler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more