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§

type Output: Debug

Output type

type Error: From<Error> + Debug

Error type returned on parse error

Required Methods§

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§

§

impl DecodeOwned for u32

§

type Output = u32

§

type Error = Error

§

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

§

impl DecodeOwned for f64

§

type Output = f64

§

type Error = Error

§

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

§

impl DecodeOwned for i64

§

type Output = i64

§

type Error = Error

§

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

§

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

§

type Error = <T as DecodeOwned>::Error

§

type Output = [<T as DecodeOwned>::Output; N]

§

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

§

impl DecodeOwned for u8

§

type Output = u8

§

type Error = Error

§

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

§

impl DecodeOwned for i16

§

type Output = i16

§

type Error = Error

§

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

§

impl DecodeOwned for i8

§

type Output = i8

§

type Error = Error

§

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

§

impl DecodeOwned for i32

§

type Output = i32

§

type Error = Error

§

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

§

impl DecodeOwned for u16

§

type Output = u16

§

type Error = Error

§

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

§

impl DecodeOwned for f32

§

type Output = f32

§

type Error = Error

§

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

§

impl DecodeOwned for u64

§

type Output = u64

§

type Error = Error

§

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

Implementors§