Trait minint::datatype::DataType

source ·
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§

Required Methods§

source

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

source

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

Provided Methods§

source

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

source

fn encode_array<W: RmpWrite>(wr: &mut W, vals: Vec<Self>) -> Result<(), ()>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl DataType for bool

source§

const DATATYPE_MSGPCK: u8 = 0u8

source§

const ARRAYDATATYPE_MSGPCK: u8 = 16u8

source§

const DATATYPE_STRING: &'static str = "boolean"

source§

const ARRAYDATATYPE_STRING: &'static str = "boolean[]"

source§

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

source§

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

source§

impl DataType for f32

source§

const DATATYPE_MSGPCK: u8 = 3u8

source§

const ARRAYDATATYPE_MSGPCK: u8 = 19u8

source§

const DATATYPE_STRING: &'static str = "float"

source§

const ARRAYDATATYPE_STRING: &'static str = "float[]"

source§

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

source§

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

source§

impl DataType for f64

source§

const DATATYPE_MSGPCK: u8 = 1u8

source§

const ARRAYDATATYPE_MSGPCK: u8 = 17u8

source§

const DATATYPE_STRING: &'static str = "double"

source§

const ARRAYDATATYPE_STRING: &'static str = "double[]"

source§

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

source§

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

source§

impl DataType for i32

source§

const DATATYPE_MSGPCK: u8 = 2u8

source§

const ARRAYDATATYPE_MSGPCK: u8 = 18u8

source§

const DATATYPE_STRING: &'static str = "int"

source§

const ARRAYDATATYPE_STRING: &'static str = "int[]"

source§

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

source§

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

source§

impl DataType for String

source§

const DATATYPE_MSGPCK: u8 = 4u8

source§

const ARRAYDATATYPE_MSGPCK: u8 = 20u8

source§

const DATATYPE_STRING: &'static str = "string"

source§

const ARRAYDATATYPE_STRING: &'static str = "string[]"

source§

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

source§

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

Implementors§