Trait cbor4ii::core::dec::Decode

source ·
pub trait Decode<'a>: Sized {
    // Required method
    fn decode_with<R: Read<'a>>(
        byte: u8,
        reader: &mut R,
    ) -> Result<Self, Error<R::Error>>;

    // Provided method
    fn decode<R: Read<'a>>(reader: &mut R) -> Result<Self, Error<R::Error>> { ... }
}
Expand description

Decode trait

Required Methods§

source

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

Decode with first byte

The first byte can be read in advance to determine the decode type.

Provided Methods§

source

fn decode<R: Read<'a>>(reader: &mut R) -> Result<Self, Error<R::Error>>

Decode to type

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> Decode<'a> for &'a str

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for Cow<'a, str>

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for bool

source§

fn decode_with<R: Read<'a>>( byte: u8, _reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for f32

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for f64

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for i8

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for i16

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for i32

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for i64

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for i128

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for u8

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for u16

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for u32

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for u64

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for u128

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a> Decode<'a> for String

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a, T: Decode<'a>> Decode<'a> for Option<T>

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

source§

impl<'a, T: Decode<'a>> Decode<'a> for Vec<T>

source§

fn decode_with<R: Read<'a>>( byte: u8, reader: &mut R, ) -> Result<Self, Error<R::Error>>

Implementors§

source§

impl<'a> Decode<'a> for BadStr<&'a [u8]>

source§

impl<'a> Decode<'a> for BadStr<Cow<'a, [u8]>>

source§

impl<'a> Decode<'a> for BadStr<Vec<u8>>

source§

impl<'a> Decode<'a> for Bytes<&'a [u8]>

source§

impl<'a> Decode<'a> for Bytes<Cow<'a, [u8]>>

source§

impl<'a> Decode<'a> for Bytes<Vec<u8>>

source§

impl<'a> Decode<'a> for F16

source§

impl<'a> Decode<'a> for Negative<u8>

source§

impl<'a> Decode<'a> for Negative<u16>

source§

impl<'a> Decode<'a> for Negative<u32>

source§

impl<'a> Decode<'a> for Negative<u64>

source§

impl<'a> Decode<'a> for Simple

source§

impl<'a> Decode<'a> for ArrayStart

source§

impl<'a> Decode<'a> for IgnoredAny

source§

impl<'a> Decode<'a> for MapStart

source§

impl<'a> Decode<'a> for TagStart

source§

impl<'a, K: Decode<'a>, V: Decode<'a>> Decode<'a> for Map<Vec<(K, V)>>

source§

impl<'a, T: Decode<'a>> Decode<'a> for Tag<T>

source§

impl<'de> Decode<'de> for Value