pub trait DataType: Sized {
const DATATYPE_MSGPCK: u8;
const ARRAYDATATYPE_MSGPCK: u8;
const DATATYPE_STRING: &'static str;
const ARRAYDATATYPE_STRING: &'static str;
// Required methods
fn decode<R: RmpRead>(rd: &mut R) -> Result<Self, ()>;
fn encode<W: RmpWrite>(wr: &mut W, val: Self) -> Result<(), ()>;
// Provided methods
fn decode_array<R: RmpRead>(rd: &mut R) -> Result<Vec<Self>, ()> { ... }
fn encode_array<W: RmpWrite>(wr: &mut W, vals: Vec<Self>) -> Result<(), ()> { ... }
}
Required Associated Constants§
const DATATYPE_MSGPCK: u8
const ARRAYDATATYPE_MSGPCK: u8
const DATATYPE_STRING: &'static str
const ARRAYDATATYPE_STRING: &'static str
Required Methods§
fn decode<R: RmpRead>(rd: &mut R) -> Result<Self, ()>
fn encode<W: RmpWrite>(wr: &mut W, val: Self) -> Result<(), ()>
Provided Methods§
fn decode_array<R: RmpRead>(rd: &mut R) -> Result<Vec<Self>, ()>
fn encode_array<W: RmpWrite>(wr: &mut W, vals: Vec<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.