Trait encdec::DecodeOwned

source ·
pub trait DecodeOwned {
    type Output: Debug;
    type Error: From<Error> + Debug;

    // Required method
    fn decode_owned(buff: &[u8]) -> Result<(Self::Output, usize), Self::Error>;
}
Expand description

Decode trait implemented for owned types

This allows eliding lifetime constraints for owned (ie. self-contained, not reference) types and provides a blanket Decode implementation

Required Associated Types§

source

type Output: Debug

Output type

source

type Error: From<Error> + Debug

Error type returned on parse error

Required Methods§

source

fn decode_owned(buff: &[u8]) -> Result<(Self::Output, usize), Self::Error>

Decode consumes a slice and returns an object and decoded length.

Implementations on Foreign Types§

source§

impl DecodeOwned for u8

source§

impl DecodeOwned for u32

source§

impl DecodeOwned for u64

source§

impl DecodeOwned for i16

source§

impl DecodeOwned for f32

source§

impl DecodeOwned for i32

source§

impl<T> DecodeOwned for Vec<T, Global>where T: DecodeOwned<Output = T> + Debug, <T as DecodeOwned>::Error: From<Error> + Debug,

DecodeOwned for alloc::vec::Vecs containing DecodeOwned types

source§

impl DecodeOwned for f64

source§

impl DecodeOwned for u16

source§

impl<T, const N: usize> DecodeOwned for [T; N]where T: DecodeOwned<Output = T> + Debug + Default + Copy, <T as DecodeOwned>::Error: From<Error> + Debug,

source§

impl DecodeOwned for i8

source§

impl<T, const N: usize> DecodeOwned for Vec<T, N>where T: DecodeOwned<Output = T> + Debug, <T as DecodeOwned>::Error: From<Error> + Debug,

DecodeOwned for [heapless::Vec]s containing DecodeOwned types

§

type Error = <T as DecodeOwned>::Error

§

type Output = Vec<<T as DecodeOwned>::Output, N>

source§

fn decode_owned( buff: &[u8] ) -> Result<(<Vec<T, N> as DecodeOwned>::Output, usize), <Vec<T, N> as DecodeOwned>::Error>

source§

impl DecodeOwned for i64

Implementors§