pub trait Encode {
type Error: EncodeError;
// Required method
fn try_serialize(self) -> Result<impl Into<Vec<u8>>, Self::Error>;
}Expand description
A payload which can be converted to a vector of bytes
Required Associated Types§
Sourcetype Error: EncodeError
type Error: EncodeError
The error type returned when encoding fails.
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.