Skip to main content

Module cobs

Module cobs 

Source
Expand description

Basic Consistent Overhead Byte Stuffing (COBS).

Functions§

decode
Decodes basic-COBS src into dst, returning the number of bytes written.
decode_in_place
Decodes basic-COBS data in place, overwriting buf with the decoded output and returning its length. The decoded bytes occupy buf[..len].
decode_in_place_with_sentinel
Decodes basic-COBS data that was encoded with an arbitrary sentinel byte in place, overwriting buf with the decoded output and returning its length. sentinel == 0 is identical to decode_in_place.
decode_to_vec
Decodes basic-COBS src, returning a newly allocated Vec.
decode_to_vec_with_sentinel
Decodes basic-COBS src that was encoded with an arbitrary sentinel byte, returning a newly allocated Vec.
decode_with_sentinel
Decodes basic-COBS src that was encoded with an arbitrary sentinel byte (see encode_with_sentinel) into dst, returning the number of bytes written. sentinel == 0 is identical to decode.
encode
Encodes src with basic COBS into dst, returning the number of bytes written.
encode_to_vec
Encodes src with basic COBS, returning a newly allocated Vec.
encode_to_vec_with_sentinel
Encodes src with basic COBS and an arbitrary sentinel byte, returning a newly allocated Vec.
encode_with_sentinel
Encodes src with basic COBS into dst using an arbitrary sentinel byte instead of 0x00, returning the number of bytes written.