Trait desert::CountBytes
source · [−]pub trait CountBytes {
fn count_from_bytes(buf: &[u8]) -> Result<usize, Error>;
fn count_bytes(&self) -> usize;
fn count_from_bytes_more(buf: &[u8]) -> Result<Option<usize>, Error> { ... }
}
Expand description
Count how many bytes to read from a byte slice for a type and calculate how many bytes the serialization would contain. The implementations for the built-in types are in big endian for this trait.
Required methods
Return how many bytes from buf
would be required to deserialize Self.
fn count_bytes(&self) -> usize
fn count_bytes(&self) -> usize
Return the number of bytes that the serialization would require.