pub struct FragmentReassembler { /* private fields */ }Expand description
Reassemble fragmented messages
Implementations§
Source§impl FragmentReassembler
impl FragmentReassembler
Sourcepub fn new(msg: &SyncMessage) -> Self
pub fn new(msg: &SyncMessage) -> Self
Create a new reassembler for a message
Sourcepub fn add_fragment(&mut self, msg: &SyncMessage) -> bool
pub fn add_fragment(&mut self, msg: &SyncMessage) -> bool
Add a fragment to the reassembler
Returns true if all fragments have been received.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if all fragments have been received
Sourcepub fn reassemble(&self) -> Option<Vec<u8>>
pub fn reassemble(&self) -> Option<Vec<u8>>
Get the reassembled payload
Returns None if not all fragments have been received.
Sourcepub fn msg_type(&self) -> SyncMessageType
pub fn msg_type(&self) -> SyncMessageType
Get the message type
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FragmentReassembler
impl RefUnwindSafe for FragmentReassembler
impl Send for FragmentReassembler
impl Sync for FragmentReassembler
impl Unpin for FragmentReassembler
impl UnwindSafe for FragmentReassembler
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