Structs§
- The
CobsDecodertype is used to decode a stream of bytes to a given mutable output slice. This is often useful when heap data structures are not available, or when not all message bytes are received at a single point in time. - The
CobsEncodertype is used to encode a stream of bytes to a given mutable output slice. This is often useful when heap data structures are not available, or when not all message bytes are received at a single point in time. - A report of the source and destination bytes used during in-place decoding
- The
EncoderStateis used to track the current state of a streaming encoder. This struct does not contain the output buffer (or a reference to one), and can be used when streaming the encoded output to a custom data type
Enums§
DecodeResultrepresents the possible non-error outcomes of pushing an encoded data byte into theDecoderStatestate machine- The
DecoderStateis used to track the current state of a streaming decoder. This struct does not contain the output buffer (or a reference to one), and can be used when streaming the decoded output to a custom data type. PushResultis used to represent the changes to an (encoded) output data buffer when an unencoded byte is pushed intoEncoderState.
Functions§
- Decodes the
sourcebuffer into thedestbuffer. - Decodes a message in-place.
- Decodes a message in-place.
- Decodes a message in-place using an arbitrary sentinel value.
- Decodes the
sourcebuffer into a vector. - Decodes the
sourcebuffer into a vector with an arbitrary sentinel value. - Decodes the
sourcebuffer into thedestbuffer using an arbitrary sentinel value. - Encodes the
sourcebuffer into thedestbuffer. - Encodes the
sourcebuffer into a vector. - Encodes the
sourcebuffer into a vector with an arbitrary sentinel value. - Encodes the
sourcebuffer into thedestbuffer using an arbitrary sentinel value. - Calculates the maximum possible size of an encoded message given the length of the source message. This may be useful for calculating how large the
destbuffer needs to be in the encoding functions. - Attempts to encode the
sourcebuffer into thedestbuffer.