DecodeOwned

Trait 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.

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.

Implementations on Foreign Types§

Source§

impl DecodeOwned for f32

Source§

type Output = f32

Source§

type Error = Error

Source§

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

Source§

impl DecodeOwned for f64

Source§

type Output = f64

Source§

type Error = Error

Source§

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

Source§

impl DecodeOwned for i8

Source§

type Output = i8

Source§

type Error = Error

Source§

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

Source§

impl DecodeOwned for i16

Source§

type Output = i16

Source§

type Error = Error

Source§

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

Source§

impl DecodeOwned for i32

Source§

type Output = i32

Source§

type Error = Error

Source§

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

Source§

impl DecodeOwned for i64

Source§

type Output = i64

Source§

type Error = Error

Source§

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

Source§

impl DecodeOwned for u8

Source§

type Output = u8

Source§

type Error = Error

Source§

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

Source§

impl DecodeOwned for u16

Source§

type Output = u16

Source§

type Error = Error

Source§

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

Source§

impl DecodeOwned for u32

Source§

type Output = u32

Source§

type Error = Error

Source§

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

Source§

impl DecodeOwned for u64

Source§

type Output = u64

Source§

type Error = Error

Source§

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

Source§

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

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

Source§

type Error = <T as DecodeOwned>::Error

Source§

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

Source§

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

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§

type Error = <T as DecodeOwned>::Error

Source§

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

Source§

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

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::Vecs containing DecodeOwned types

Source§

type Error = <T as DecodeOwned>::Error

Source§

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

Source§

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

Implementors§

Source§

impl<T: Flags + Debug + EncDecBitflags> DecodeOwned for T
where <T as Flags>::Bits: DecodeOwned<Output = <T as Flags>::Bits, Error = Error>,