pub struct Chunks {
pub ssn: u16,
pub mid: u32,
pub ppi: PayloadProtocolIdentifier,
pub ppid: u32,
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
mid: u32The Message Identifier, when the message came in I-DATA chunks (RFC 8260): counted per stream, separately for ordered and unordered messages. Zero otherwise.
ppi: PayloadProtocolIdentifierThe payload protocol identifier shared by every fragment of this message.
ppid: u32The Payload Protocol Identifier as the number the peer sent (RFC 9260 3.3.1): the
value of ppi when that has a name for it, and the only way to tell apart the values
it calls Unknown.
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.