Trait canadensis_encoding::Serialize
source · [−]pub trait Serialize: DataType {
fn size_bits(&self) -> usize;
fn serialize(&self, cursor: &mut WriteCursor<'_>);
fn serialize_to_bytes(&self, bytes: &mut [u8]) { ... }
}
Expand description
Trait for types that can be serialized into UAVCAN transfers
Required methods
Returns the size of the encoded form of this value, in bits
For composite types, this must be a multiple of 8.
fn serialize(&self, cursor: &mut WriteCursor<'_>)
fn serialize(&self, cursor: &mut WriteCursor<'_>)
Serializes this value into a buffer
The provided cursor will allow writing at least the number of bits returned by the
size_bits()
function.