pub enum Variant {
Show 26 variants
Null,
Boolean(bool),
Ubyte(u8),
Ushort(u16),
Uint(u32),
Ulong(u64),
Byte(i8),
Short(i16),
Int(i32),
Long(i64),
Float(OrderedFloat<f32>),
Double(OrderedFloat<f64>),
Decimal32([u8; 4]),
Decimal64([u8; 8]),
Decimal128([u8; 16]),
Char(char),
Timestamp(DateTime<Utc>),
Uuid(Uuid),
Binary(Bytes),
String(Str),
Symbol(Symbol),
List(List),
Map(VariantMap),
Array(Array),
Described((Descriptor, Box<Variant>)),
DescribedCompound(DescribedCompound),
}Expand description
Represents an AMQP type for use in polymorphic collections
Variants§
Null
Indicates an empty value.
Boolean(bool)
Represents a true or false value.
Ubyte(u8)
Integer in the range 0 to 2^8 - 1 inclusive.
Ushort(u16)
Integer in the range 0 to 2^16 - 1 inclusive.
Uint(u32)
Integer in the range 0 to 2^32 - 1 inclusive.
Ulong(u64)
Integer in the range 0 to 2^64 - 1 inclusive.
Byte(i8)
Integer in the range 0 to 2^7 - 1 inclusive.
Short(i16)
Integer in the range 0 to 2^15 - 1 inclusive.
Int(i32)
Integer in the range 0 to 2^32 - 1 inclusive.
Long(i64)
Integer in the range 0 to 2^64 - 1 inclusive.
Float(OrderedFloat<f32>)
32-bit floating point number (IEEE 754-2008 binary32).
Double(OrderedFloat<f64>)
64-bit floating point number (IEEE 754-2008 binary64).
Decimal32([u8; 4])
32-bit decimal number, represented per IEEE 754-2008 decimal32 specification.
Decimal64([u8; 8])
64-bit decimal number, represented per IEEE 754-2008 decimal64 specification.
Decimal128([u8; 16])
128-bit decimal number, represented per IEEE 754-2008 decimal128 specification.
Char(char)
A single Unicode character.
Timestamp(DateTime<Utc>)
An absolute point in time. Represents an approximate point in time using the Unix time encoding of UTC with a precision of milliseconds. For example, 1311704463521 represents the moment 2011-07-26T18:21:03.521Z.
Uuid(Uuid)
A universally unique identifier as defined by RFC-4122 section 4.1.2
Binary(Bytes)
A sequence of octets.
String(Str)
A sequence of Unicode characters
Symbol(Symbol)
Symbolic values from a constrained domain.
List(List)
List
Map(VariantMap)
Map
Array(Array)
Array
Described((Descriptor, Box<Variant>))
Described value of primitive type. See Variant::DescribedCompound for
DescribedCompound(DescribedCompound)
Described value of compound or array type. See Variant::DescribedCompound for details.
Implementations§
Source§impl Variant
impl Variant
pub fn as_str(&self) -> Option<&str>
Sourcepub fn as_long(&self) -> Option<i64>
pub fn as_long(&self) -> Option<i64>
Expresses integer-typed variant values as i64 value when possible. Notably, does not include ulong.
Returns None for variants other than supported integers.
Sourcepub fn as_ulong(&self) -> Option<u64>
pub fn as_ulong(&self) -> Option<u64>
Expresses unsigned integer-typed variant values as u64 value. Returns None for variants other than unsigned integers.