pub struct Reassembler { /* private fields */ }Expand description
Zero-copy block assembly state machine.
Implementations§
Source§impl Reassembler
impl Reassembler
pub fn new(packet_payload: usize, stats: StreamStatsAccumulator) -> Self
Sourcepub fn start_block(
&mut self,
block_id: u16,
expected_packets: usize,
buffer: BytesMut,
)
pub fn start_block( &mut self, block_id: u16, expected_packets: usize, buffer: BytesMut, )
Start a new block, evicting the previous one when necessary.
Sourcepub fn push_packet(&mut self, packet_id: usize, payload: &[u8])
pub fn push_packet(&mut self, packet_id: usize, payload: &[u8])
Insert a packet belonging to the active block.
Sourcepub fn finish_block(&mut self) -> Option<Bytes>
pub fn finish_block(&mut self) -> Option<Bytes>
Attempt to finish the current block.
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 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