Type Alias Value

Source
pub type Value = Value;

Aliased Type§

pub enum Value {
    Nil,
    Boolean(bool),
    Integer(Integer),
    F32(f32),
    F64(f64),
    String(Utf8String),
    Binary(Vec<u8>),
    Array(Vec<Value>),
    Map(Vec<(Value, Value)>),
    Ext(i8, Vec<u8>),
}

Variants§

§

Nil

Nil represents nil.

§

Boolean(bool)

Boolean represents true or false.

§

Integer(Integer)

Integer represents an integer.

A value of an Integer object is limited from -(2^63) upto (2^64)-1.

§Examples

use rmpv::Value;

assert_eq!(42, Value::from(42).as_i64().unwrap());
§

F32(f32)

A 32-bit floating point number.

§

F64(f64)

A 64-bit floating point number.

§

String(Utf8String)

String extending Raw type represents a UTF-8 string.

§Note

String objects may contain invalid byte sequence and the behavior of a deserializer depends on the actual implementation when it received invalid byte sequence. Deserializers should provide functionality to get the original byte array so that applications can decide how to handle the object

§

Binary(Vec<u8>)

Binary extending Raw type represents a byte array.

§

Array(Vec<Value>)

Array represents a sequence of objects.

§

Map(Vec<(Value, Value)>)

Map represents key-value pairs of objects.

§

Ext(i8, Vec<u8>)

Extended implements Extension interface: represents a tuple of type information and a byte array where type information is an integer whose meaning is defined by applications.