pub trait PayloadEncode: PayloadHooks + ProtocolSchema {
// Required method
fn encode(&self, ctx: &mut Self::Context<'_>) -> Result<Vec<u8>>;
}Expand description
Trait for serializing a payload into a byte buffer.
Requires PayloadHooks, so before_encode() will always be invoked before encoding.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".