pub trait WritableToBeBytes {
// Required methods
fn raw_len(&self) -> usize;
fn write_to_be_bytes(
&self,
buf: &mut [u8],
) -> Result<usize, ByteConversionError>;
}Expand description
Generic trait which is used for objects which can be converted into a raw network (big) endian byte format.
Required Methods§
fn raw_len(&self) -> usize
Sourcefn write_to_be_bytes(
&self,
buf: &mut [u8],
) -> Result<usize, ByteConversionError>
fn write_to_be_bytes( &self, buf: &mut [u8], ) -> Result<usize, ByteConversionError>
Writes the object to a raw buffer in network endianness (big)