Skip to main content

decode_message_set

Function decode_message_set 

Source
pub fn decode_message_set<B: Buf>(
    buf: &mut B,
    set_size_bytes: usize,
) -> Result<Vec<ParsedRecord>, LegacyRecordsError>
Expand description

Decode a flat, uncompressed MessageSet from buf.

This function consumes exactly set_size_bytes bytes from the buffer. It unwraps a compressed wrapper message at the top level one time. It rejects nested compression, that is, a compressed wrapper inside a compressed wrapper.

ยงErrors

Returns Truncated if buf holds fewer than set_size_bytes bytes. Returns Truncated if an entry header or an entry body stops early. Returns NegativeLength if an entry carries a negative message_size. Returns NestedCompression if a compressed wrapper holds another compressed wrapper. Returns the error from Message::decode_from for a malformed or corrupt message frame. Returns a compression error if the wrapper value does not decompress within the default policy.