pub struct Reassembler { /* private fields */ }Expand description
Reassembles fragments into complete messages with bounded memory, LRU eviction, stale pruning, and duplicate integrity checks.
Implementations§
Source§impl Reassembler
impl Reassembler
pub fn new(config: ReassemblerConfig) -> Self
Sourcepub fn add_fragment(
&mut self,
fragment: Fragment,
) -> Result<Option<Vec<u8>>, FragmentationError>
pub fn add_fragment( &mut self, fragment: Fragment, ) -> Result<Option<Vec<u8>>, FragmentationError>
Returns Ok(Some(data)) if this fragment completed a message, Ok(None) if more needed.
pub fn prune_stale(&mut self, timeout: Duration) -> usize
pub fn prune_stale_default(&mut self) -> usize
pub fn buffered_bytes(&self) -> usize
pub fn pending_count(&self) -> usize
pub fn has_message(&self, message_id: u64) -> bool
pub fn message_progress(&self, message_id: u64) -> Option<(u32, u32)>
Trait Implementations§
Auto Trait Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more