Skip to main content

encode_bytes_with_options

Function encode_bytes_with_options 

Source
pub fn encode_bytes_with_options<T: Serialize>(
    protocol: ProtocolVersion,
    kind: MessageKind,
    value: &T,
    options: EncodeOptions,
) -> Result<Bytes, CodecError>
Expand description

Encodes a checksummed frame into a controlled BytesMut construction buffer and freezes it for immutable sharing at the transport boundary.

ยงErrors

Returns CodecError for serialization, compression, or length failures.