pub struct Chunks {
pub ssn: u16,
pub ppi: PayloadProtocolIdentifier,
pub chunks: Vec<ChunkPayloadData>,
/* private fields */
}Expand description
Chunks is a set of chunks that share the same SSN
Fields§
§ssn: u16used only with the ordered chunks
ppi: PayloadProtocolIdentifierThe payload protocol identifier shared by every fragment of this message.
chunks: Vec<ChunkPayloadData>The fragments, in order, that make up one complete message.
Implementations§
Source§impl Chunks
impl Chunks
Sourcepub fn to_payload(&self, max_len: usize) -> Result<BytesMut>
pub fn to_payload(&self, max_len: usize) -> Result<BytesMut>
Reassemble all fragments into a single freshly-allocated, exactly-sized buffer with one copy.
Unlike read, this does not round-trip through a
caller-provided scratch buffer, eliminating one full-payload copy on the
receive path (the reassembled message would otherwise be copied into the
scratch buffer and then again into the delivered BytesMut). Returns
Error::ErrShortBuffer when the message exceeds max_len, mirroring
read’s bound so oversized inbound messages are still rejected.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chunks
impl RefUnwindSafe for Chunks
impl Send for Chunks
impl Sync for Chunks
impl Unpin for Chunks
impl UnsafeUnpin for Chunks
impl UnwindSafe for Chunks
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