pub trait Serialize {
type Error;
// Required methods
fn serialized_len(&self) -> usize;
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize, Self::Error>;
// Provided method
fn to_bytes(&self) -> Vec<u8> ⓘ
where Self::Error: Debug { ... }
}Expand description
Serialize a DVB structure back to bytes. Split from Parse so owned
and borrowed variants of the same type can implement Serialize
without carrying a lifetime.
Required Associated Types§
Required Methods§
Sourcefn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Number of bytes serialize_into will write.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".