Function cobs::try_encode

source ·
pub fn try_encode(source: &[u8], dest: &mut [u8]) -> Result<usize, ()>
Expand description

Attempts to encode the source buffer into the dest buffer.

This function uses the typical sentinel value of 0. It returns the number of bytes written to in the dest buffer.

If the destination buffer does not have enough room, an error will be returned