Trait cuprate_levin::LevinBody
source · 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
Object Safety§
This trait is not object safe.