Enum serde_amqp::value::Value

source ·
pub enum Value {
Show 25 variants Described(Box<Described<Value>>), Null, Bool(bool), Ubyte(u8), Ushort(u16), Uint(u32), Ulong(u64), Byte(i8), Short(i16), Int(i32), Long(i64), Float(OrderedFloat<f32>), Double(OrderedFloat<f64>), Decimal32(Dec32), Decimal64(Dec64), Decimal128(Dec128), Char(char), Timestamp(Timestamp), Uuid(Uuid), Binary(ByteBuf), String(String), Symbol(Symbol), List(Vec<Value>), Map(OrderedMap<Value, Value>), Array(Array<Value>),
}
Expand description

Primitive type definitions

Variants§

§

Described(Box<Described<Value>>)

Described type

Box is used to reduce the memory size of the Value type.

§

Null

Indicates an empty value

encoding code = 0x40, category = fixed, width = 0, label = “the null value”

§

Bool(bool)

Represents a true or false value

encoding code = 0x56 category = fixed, width = 1 label = “boolean with the octet 0x00 being false and octet 0x01 being true”

encoding name = “true”, encoding code = 0x41 category = fixed, width = 0 label = “the boolean value true”

encoding name = “false”, encoding code = 0x42 category = fixed, width = 0 label = “the boolean value false”

§

Ubyte(u8)

Integer in the range 0 to 2^8-1 inclusive

encoding code = 0x50, category = fixed, width = 1 label = “8-bit unsigned integer”

§

Ushort(u16)

Integer in the range 0 to 2^16-1 inclusive

encoding code = 0x60, category = fixed, width = 2 label = “16-bit unsigned integer in network byte order” (AKA. Big-Endian, rust uses BigEndian by default)

§

Uint(u32)

Integer in the range 0 to 2^32-1 inclusive

encoding code = 0x70, category = fixed, width = 4 label = “32-bit unsigned integer in network byte order” (AKA. Big-Endian, rust uses BigEndian by default)

encoding name = “smalluint”, encoding code = 0x52 category = fixed, width = 1 label = “unsigned integer value in the range 0 to 255 inclusive”

encoding name = “uint0”, encoding code = 0x43 category = fixed, width = 0 label = “the uint value 0”

§

Ulong(u64)

Integer in the range 0 to 2^64-1 inclusive

encoding code = 0x80, category = fixed, width = 8 label = “64-bit unsigned integer in network byte order” (AKA. Big-Endian, rust uses BigEndian by default)

encoding name = “smallulong”, encoding code = 0x53 category = fixed, width = 1 label = “unsigned long value in the range 0 to 255 inclusive”

encoding name = “ulong0”, encoding code = 0x44 category = fixed, width = 0 label = “the ulong value 0”

§

Byte(i8)

Integer in the range -(2^7) to 2^7-1 inclusive

encoding code = 0x51, category = fixed, width = 1 label = “8-bit two’s-complement integer”

§

Short(i16)

Integer in the range -(2^15) to 2^15-1 inclusive

encoding code = 0x61, category = fixed, width = 2 label = “16-bit two’s-complement integer in network byte order”

§

Int(i32)

Integer in the range -(2^31) to 2^31-1 inclusive

encoding code = 0x71, category = fixed, width = 4 label = “32-bit two’s-complement integer in network byte order”

encoding name = “smallint”, encoding code = 0x54 category = fixed, width = 1 label = “8-bit two’s-complement integer”

§

Long(i64)

Integer in the range -(2^63) to 2^63-1 inclusive

encoding code = 0x81, category = fixed, width = 8 label = “64-bit two’s-complement integer in network byte order”

encoding name = “smalllong”, encoding code = 0x55 category = fixed, width = 1 label = “8-bit two’s-complement integer”

§

Float(OrderedFloat<f32>)

32-bit floating point number (IEEE 754-2008 binary32)

encoding name = “ieee-754”, encoding code = 0x72 category = fixed, width = 4 label = “IEEE 754-2008 binary32”

§

Double(OrderedFloat<f64>)

64-bit floating point number (IEEE 754-2008 binary64).

encoding name = “ieee-754”, encoding code = 0x82 category = fixed, width = 8 label = “IEEE 754-2008 binary64”

§

Decimal32(Dec32)

32-bit decimal number (IEEE 754-2008 decimal32).

encoding name = “ieee-754”, encoding code = 0x74 category = fixed, width = 4 label = “IEEE 754-2008 decimal32 using the Binary Integer Decimal encoding”

§

Decimal64(Dec64)

64-bit decimal number (IEEE 754-2008 decimal64).

encoding name = “ieee-754”, encoding code = 0x84 category = fixed, width = 8 label = “IEEE 754-2008 decimal64 using the Binary Integer Decimal encoding”

§

Decimal128(Dec128)

128-bit decimal number (IEEE 754-2008 decimal128).

encoding name = “ieee-754”, encoding code = 0x94 category = fixed, width = 16 label = “IEEE 754-2008 decimal128 using the Binary Integer Decimal encoding”

§

Char(char)

A single Unicode character

encoding name = “utf32”, encoding code = 0x73 category = fixed, width = 4, label = “a UTF-32BE encoded Unicode character”

§

Timestamp(Timestamp)

An absolute point in time

encoding name = “ms64”, code = 0x83, category = fixed, width = 8 label = “64-bit two’s-complement integer representing milliseconds since the unix epoch”

§

Uuid(Uuid)

A universally unique identifier as defined by RFC-4122 in section 4.1.2

encoding code = 0x98, category = fixed, width = 16, label=“UUID as defined in section 4.1.2 of RFC-4122”

§

Binary(ByteBuf)

A sequence of octets.

encoding name = “vbin8”, encoding code = 0xa0 category = variable, width = 1 label = “up to 2^8 - 1 octets of binary data”

encoding name = “vbin32”, encoding code = 0xb0, category = variable, width = 4, label=“up to 2^32 - 1 octets of binary data”

§

String(String)

A sequence of Unicode characters.

encoding name = “str8-utf8”, encoding code = 0xa1, category = variable, width = 1 label = “up to 2^8 - 1 octets worth of UTF-8 Unicode (with no byte order mark)”

encoding name = “str32-utf8”, encoding code = 0xb1 category = variable, width = 4 label=“up to 2^32 - 1 octets worth of UTF-8 Unicode (with no byte order mark)”

§

Symbol(Symbol)

Symbolic values from a constrained domain.

encoding name = “sym8”, encoding code = 0xa3, category = variable, width = 1 label=“up to 2^8 - 1 seven bit ASCII characters representing a symbolic value”

encoding name = “sym32”, encoding code = 0xb3 category = variable, width = 4 label=“up to 2^32 - 1 seven bit ASCII characters representing a symbolic value”

Symbols are values from a constrained domain. Although the set of possible domains is open-ended, typically the both number and size of symbols in use for any given application will be small, e.g. small enough that it is reasonable to cache all the distinct values. Symbols are encoded as ASCII characters ASCII.

§

List(Vec<Value>)

A sequence of polymorphic values.

encoding name = “list0”, encoding code = 0x45 category = fixed, width = 0, label=“the empty list (i.e. the list with no elements)”

encoding name = “list8”, encoding code = 0xc0 category = compound, width = 1 label=“up to 2^8 - 1 list elements with total size less than 2^8 octets

encoding name = “list32”, encoding code = 0xd0 category = compound, width = 4 label=“up to 2^32 - 1 list elements with total size less than 2^32 octets”

§

Map(OrderedMap<Value, Value>)

A polymorphic mapping from distinct keys to values.

encoding name = “map8”, encoding code = 0xc1, category = compound, width = 1 label=“up to 2^8 - 1 octets of encoded map data”

encoding name = “map32”, encoding code = 0xd1, category = compound, width = 4 label=“up to 2^32 - 1 octets of encoded map data

Map encodings MUST contain an even number of items (i.e. an equal number of keys and values). A map in which there exist two identical key values is invalid. Unless known to be otherwise, maps MUST be considered to be ordered, that is, the order of the key-value pairs is semantically important and two maps which are different only in the order in which their key-value pairs are encoded are not equal.

Note: Can only use BTreeMap as it must be considered to be ordered

§

Array(Array<Value>)

A sequence of values of a single type.

encoding name = “array8”, encoding code = 0xe0 category = array, width = 1, label=“up to 2^8 - 1 array elements with total size less than 2^8 octets”

encoding name = “array32”, encoding code = 0xf0, category = array, width = 4 label=“up to 2^32 - 1 array elements with total size less than 2^32 octets”

Implementations§

source§

impl Value

source

pub fn format_code(&self) -> u8

Get the format code of the value type

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Value

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Value

source§

fn default() -> Value

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Value

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&str> for Value

source§

fn from(val: &str) -> Self

Converts to this type from the input type.
source§

impl<T> From<Array<T>> for Value
where T: Into<Value>,

source§

fn from(values: Array<T>) -> Self

Converts to this type from the input type.
source§

impl<K, V> From<BTreeMap<K, V>> for Value
where K: Into<Value>, V: Into<Value>,

source§

fn from(map: BTreeMap<K, V>) -> Self

Converts to this type from the input type.
source§

impl From<ByteBuf> for Value

source§

fn from(val: ByteBuf) -> Self

Converts to this type from the input type.
source§

impl From<Dec128> for Value

source§

fn from(val: Dec128) -> Self

Converts to this type from the input type.
source§

impl From<Dec32> for Value

source§

fn from(val: Dec32) -> Self

Converts to this type from the input type.
source§

impl From<Dec64> for Value

source§

fn from(val: Dec64) -> Self

Converts to this type from the input type.
source§

impl<T> From<Described<T>> for Value
where T: Into<Value>,

source§

fn from(value: Described<T>) -> Self

Converts to this type from the input type.
source§

impl From<OrderedFloat<f32>> for Value

source§

fn from(val: OrderedFloat<f32>) -> Self

Converts to this type from the input type.
source§

impl From<OrderedFloat<f64>> for Value

source§

fn from(val: OrderedFloat<f64>) -> Self

Converts to this type from the input type.
source§

impl<K, V> From<OrderedMap<K, V>> for Value
where K: Into<Value>, V: Into<Value>,

source§

fn from(map: OrderedMap<K, V>) -> Self

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(val: String) -> Self

Converts to this type from the input type.
source§

impl From<Symbol> for Value

source§

fn from(val: Symbol) -> Self

Converts to this type from the input type.
source§

impl From<Timestamp> for Value

source§

fn from(val: Timestamp) -> Self

Converts to this type from the input type.
source§

impl From<Uuid> for Value

source§

fn from(val: Uuid) -> Self

Converts to this type from the input type.
source§

impl From<Value> for Value

source§

fn from(value: Value) -> Self

Converts to this type from the input type.
source§

impl<T> From<Vec<T>> for Value
where T: Into<Value>,

source§

fn from(values: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(val: bool) -> Self

Converts to this type from the input type.
source§

impl From<char> for Value

source§

fn from(val: char) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Value

source§

fn from(val: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(val: f64) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Value

source§

fn from(val: i16) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(val: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(val: i64) -> Self

Converts to this type from the input type.
source§

impl From<i8> for Value

source§

fn from(val: i8) -> Self

Converts to this type from the input type.
source§

impl From<u16> for Value

source§

fn from(val: u16) -> Self

Converts to this type from the input type.
source§

impl From<u32> for Value

source§

fn from(val: u32) -> Self

Converts to this type from the input type.
source§

impl From<u64> for Value

source§

fn from(val: u64) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Value

source§

fn from(val: u8) -> Self

Converts to this type from the input type.
source§

impl Hash for Value

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Value

source§

fn cmp(&self, other: &Value) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Value

source§

fn eq(&self, other: &Value) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Value

source§

fn partial_cmp(&self, other: &Value) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for Value

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T> TryFrom<Value> for Array<T>
where T: TryFrom<Value, Error = Value>,

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<K, V> TryFrom<Value> for BTreeMap<K, V>
where K: TryFrom<Value, Error = Value> + Ord, V: TryFrom<Value, Error = Value>,

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for ByteBuf

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Dec128

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Dec32

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Dec64

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<K, V> TryFrom<Value> for HashMap<K, V>
where K: TryFrom<Value, Error = Value> + Hash + Eq, V: TryFrom<Value, Error = Value>,

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<K, V> TryFrom<Value> for IndexMap<K, V>
where K: TryFrom<Value, Error = Value> + Hash + Eq, V: TryFrom<Value, Error = Value>,

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for OrderedFloat<f32>

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for OrderedFloat<f64>

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<K, V> TryFrom<Value> for OrderedMap<K, V>
where K: TryFrom<Value, Error = Value> + Hash + Eq, V: TryFrom<Value, Error = Value>,

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for String

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Symbol

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Timestamp

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for Uuid

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<T> TryFrom<Value> for Vec<T>
where T: TryFrom<Value, Error = Value>,

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for bool

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for char

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for f32

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for f64

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for i16

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for i32

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for i64

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for i8

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for u16

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for u32

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for u64

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Value> for u8

§

type Error = Value

The type returned in the event of a conversion error.
source§

fn try_from(val: Value) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for Value

source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,