Trait DataWrap

Source
pub trait DataWrap: Sized + Debug {
    const MSGPCK: u8;
    const STRING: &'static str;

    // Required methods
    fn decode<R: RmpRead>(rd: &mut R) -> Result<Self, ()>;
    fn encode<W: RmpWrite>(wr: &mut W, val: Self) -> Result<(), ()>;
}

Required Associated Constants§

Source

const MSGPCK: u8

Source

const STRING: &'static str

Required Methods§

Source

fn decode<R: RmpRead>(rd: &mut R) -> Result<Self, ()>

Source

fn encode<W: RmpWrite>(wr: &mut W, val: Self) -> Result<(), ()>

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<T: DataType + Debug> DataWrap for Vec<T>

Source§

const MSGPCK: u8 = T::ARRAYDATATYPE_MSGPCK

Source§

const STRING: &'static str = T::ARRAYDATATYPE_STRING

Source§

fn decode<R: RmpRead>(rd: &mut R) -> Result<Self, ()>

Source§

fn encode<W: RmpWrite>(wr: &mut W, val: Self) -> Result<(), ()>

Implementors§

Source§

impl<T: DataType + Debug> DataWrap for T

Source§

const MSGPCK: u8 = Self::DATATYPE_MSGPCK

Source§

const STRING: &'static str = Self::DATATYPE_STRING