cuprate_levin

Trait 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§

Required Methods§

Source

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

Source

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.

Implementors§