pub trait ToBytes {
// Required method
fn to_bytes(&self) -> &[u8] ⓘ;
}Expand description
A cheap conversion from typed data to a byte slice.
Given some data, returns the byte representation of that data. No copy of the data should be performed.
See also the FromBytes trait.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".