LengthDelimitedDecoder

Trait LengthDelimitedDecoder 

Source
pub trait LengthDelimitedDecoder: Debug {
    type Error;

    // Required methods
    fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
       where Self: Sized;
    fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
       where Self: Sized;
}
Expand description

A type can be encode to a buffer.

Required Associated Types§

Source

type Error

The decode error type that can be returned when decoding the type.

Required Methods§

Source

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Decodes an instance of the message from a buffer.

The entire buffer will be consumed.

Source

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Decodes a length-delimited instance of the message from the buffer.

Implementations on Foreign Types§

Source§

impl LengthDelimitedDecoder for bool

Source§

type Error = IncompleteBuffer

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for char

Source§

type Error = DecodeCharError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for f32

Source§

type Error = IncompleteBuffer

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for f64

Source§

type Error = IncompleteBuffer

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for i8

Source§

type Error = <u8 as LengthDelimitedDecoder>::Error

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for i16

Source§

type Error = DecodeError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for i32

Source§

type Error = DecodeError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for i64

Source§

type Error = DecodeError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for i128

Source§

type Error = DecodeError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for u8

Source§

type Error = IncompleteBuffer

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for u16

Source§

type Error = DecodeError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for u32

Source§

type Error = DecodeError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for u64

Source§

type Error = DecodeError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for u128

Source§

type Error = DecodeError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Box<str>

Source§

type Error = DecodeUtf8BytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Box<[u8]>

Source§

type Error = DecodeBytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Rc<str>

Source§

type Error = DecodeUtf8BytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Rc<[u8]>

Source§

type Error = DecodeBytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for String

Source§

type Error = DecodeUtf8BytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Arc<str>

Source§

type Error = DecodeUtf8BytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Arc<[u8]>

Source§

type Error = DecodeBytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Vec<u8>

Source§

type Error = DecodeBytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Ipv4Addr

Source§

type Error = DecodeError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Ipv6Addr

Source§

type Error = DecodeError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for SocketAddrV4

Source§

type Error = DecodeSocketAddrError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for SocketAddrV6

Source§

type Error = DecodeSocketAddrError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for BString

Source§

type Error = DecodeBytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Bytes

Source§

type Error = DecodeBytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for FastStr

Source§

type Error = DecodeUtf8BytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for SmolStr

Source§

type Error = DecodeUtf8BytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Arc<str>

Source§

type Error = DecodeUtf8BytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl LengthDelimitedDecoder for Arc<[u8]>

Source§

type Error = DecodeBytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

impl<const N: usize> LengthDelimitedDecoder for [u8; N]

Source§

type Error = DecodeBytesError

Source§

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Source§

fn decode_length_delimited(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Implementors§