pub trait LevinBody: Sized {
type Command: LevinCommand + Debug;
// Required methods
fn decode_message<B: Buf>(
body: &mut B,
typ: MessageType,
command: Self::Command,
) -> Result<Self, BucketError>;
fn encode(
self,
builder: &mut BucketBuilder<Self::Command>,
) -> Result<(), BucketError>;
}
Expand description
A levin body
Required Associated Types§
type Command: LevinCommand + Debug
Required Methods§
Sourcefn decode_message<B: Buf>(
body: &mut B,
typ: MessageType,
command: Self::Command,
) -> Result<Self, BucketError>
fn decode_message<B: Buf>( body: &mut B, typ: MessageType, command: Self::Command, ) -> Result<Self, BucketError>
Decodes the message from the data in the header
Sourcefn encode(
self,
builder: &mut BucketBuilder<Self::Command>,
) -> Result<(), BucketError>
fn encode( self, builder: &mut BucketBuilder<Self::Command>, ) -> Result<(), BucketError>
Encodes the message
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.