Trait LengthDelimitedFrame

Source
pub trait LengthDelimitedFrame:
    Decoder
    + Encoder
    + Sized {
    type Length: Decoder<usize> + Encoder<usize>;
    type Error: From<Error> + From<<Self as Decoder>::Error> + From<<Self as Encoder>::Error> + From<<Self::Length as Decoder<usize>>::Error> + From<<Self::Length as Encoder<usize>>::Error>;

    const MAX_FRAME_LEN: usize = 8_388_608usize;
}
Expand description

Trait for frames that can be decoded for encoded as a length-delimited sequence of bytes.

Provided Associated Constants§

Source

const MAX_FRAME_LEN: usize = 8_388_608usize

Maximum frame length.

Required Associated Types§

Source

type Length: Decoder<usize> + Encoder<usize>

Type representing the length of a frame.

Source

type Error: From<Error> + From<<Self as Decoder>::Error> + From<<Self as Encoder>::Error> + From<<Self::Length as Decoder<usize>>::Error> + From<<Self::Length as Encoder<usize>>::Error>

Error type that can be returned when decoding/encoding a frame.

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§