pub trait ToBytes: Sized {
// Required method
fn to_bytes(&self, writer: &mut dyn Write) -> Result<(), Error>;
}
Expand description
ToBytes
indicates that the type can be directly translated to a
byte-oriented format. This is primarily used for types that represent
structures used in a wire format.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.