pub fn serialize<F, T>(
value: T,
output: &mut [u8]
) -> Result<(usize, usize), BufferExhausted>where
F: Formula + ?Sized,
T: Serialize<F>,
Expand description
Serialize value into bytes slice. Returns the number of bytes written. Fails if the buffer is too small.
To retrieve the number of bytes required to serialize the value,
use serialized_size
or serialize_or_size
.
Errors
Returns BufferExhausted
if the buffer is too small.