Enum amq_protocol_types::AMQPValue
source · pub enum AMQPValue {
Show 18 variants
Boolean(Boolean),
ShortShortInt(ShortShortInt),
ShortShortUInt(ShortShortUInt),
ShortInt(ShortInt),
ShortUInt(ShortUInt),
LongInt(LongInt),
LongUInt(LongUInt),
LongLongInt(LongLongInt),
Float(Float),
Double(Double),
DecimalValue(DecimalValue),
ShortString(ShortString),
LongString(LongString),
FieldArray(FieldArray),
Timestamp(Timestamp),
FieldTable(FieldTable),
ByteArray(ByteArray),
Void,
}
Expand description
Enumeration referencing the possible AMQP values depending on the types
Variants§
Boolean(Boolean)
A bool
ShortShortInt(ShortShortInt)
An i8
ShortShortUInt(ShortShortUInt)
A u8
ShortInt(ShortInt)
An i16
ShortUInt(ShortUInt)
A u16
LongInt(LongInt)
An i32
LongUInt(LongUInt)
A u32
LongLongInt(LongLongInt)
An i64
Float(Float)
An f32
Double(Double)
An f64
DecimalValue(DecimalValue)
A decimal value
ShortString(ShortString)
A String (deprecated)
LongString(LongString)
A String
FieldArray(FieldArray)
An array of AMQPValue
Timestamp(Timestamp)
A timestamp (u64)
FieldTable(FieldTable)
A Map<String, AMQPValue>
ByteArray(ByteArray)
An array of bytes (RabbitMQ specific)
Void
No value
Implementations§
source§impl AMQPValue
impl AMQPValue
sourcepub fn try_from(value: &Value, amqp_type: AMQPType) -> Option<AMQPValue>
pub fn try_from(value: &Value, amqp_type: AMQPType) -> Option<AMQPValue>
Convert a serde_json::Value into an AMQPValue
sourcepub fn as_bool(&self) -> Option<Boolean>
pub fn as_bool(&self) -> Option<Boolean>
If the value is bool, returns associated value. Returns None otherwise.
sourcepub fn as_short_short_int(&self) -> Option<ShortShortInt>
pub fn as_short_short_int(&self) -> Option<ShortShortInt>
If the value is ShortShortInt, returns associated value. Returns None otherwise.
sourcepub fn as_short_short_uint(&self) -> Option<ShortShortUInt>
pub fn as_short_short_uint(&self) -> Option<ShortShortUInt>
If the value is ShortShortUInt, returns associated value. Returns None otherwise.
sourcepub fn as_short_int(&self) -> Option<ShortInt>
pub fn as_short_int(&self) -> Option<ShortInt>
If the value is ShortInt, returns associated value. Returns None otherwise.
sourcepub fn as_short_uint(&self) -> Option<ShortUInt>
pub fn as_short_uint(&self) -> Option<ShortUInt>
If the value is ShortUInt, returns associated value. Returns None otherwise.
sourcepub fn as_long_int(&self) -> Option<LongInt>
pub fn as_long_int(&self) -> Option<LongInt>
If the value is LongInt, returns associated value. Returns None otherwise.
sourcepub fn as_long_uint(&self) -> Option<LongUInt>
pub fn as_long_uint(&self) -> Option<LongUInt>
If the value is LongUInt, returns associated value. Returns None otherwise.
sourcepub fn as_long_long_int(&self) -> Option<LongLongInt>
pub fn as_long_long_int(&self) -> Option<LongLongInt>
If the value is LongLongInt, returns associated value. Returns None otherwise.
sourcepub fn as_float(&self) -> Option<Float>
pub fn as_float(&self) -> Option<Float>
If the value is Float, returns associated value. Returns None otherwise.
sourcepub fn as_double(&self) -> Option<Double>
pub fn as_double(&self) -> Option<Double>
If the value is Double, returns associated value. Returns None otherwise.
sourcepub fn as_decimal_value(&self) -> Option<DecimalValue>
pub fn as_decimal_value(&self) -> Option<DecimalValue>
If the value is DecimalValue, returns associated value. Returns None otherwise.
sourcepub fn as_short_string(&self) -> Option<&ShortString>
pub fn as_short_string(&self) -> Option<&ShortString>
If the value is ShortString, returns associated value as str. Returns None otherwise.
sourcepub fn as_long_string(&self) -> Option<&LongString>
pub fn as_long_string(&self) -> Option<&LongString>
If the value is LongString, returns associated value as bytes. Returns None otherwise.
sourcepub fn as_array(&self) -> Option<&FieldArray>
pub fn as_array(&self) -> Option<&FieldArray>
If the value is FieldArray, returns associated value. Returns None otherwise.
sourcepub fn as_timestamp(&self) -> Option<Timestamp>
pub fn as_timestamp(&self) -> Option<Timestamp>
If the value is Timestamp, returns associated value. Returns None otherwise.
sourcepub fn as_field_table(&self) -> Option<&FieldTable>
pub fn as_field_table(&self) -> Option<&FieldTable>
If the value is FieldTable, returns associated value. Returns None otherwise.
sourcepub fn as_byte_array(&self) -> Option<&ByteArray>
pub fn as_byte_array(&self) -> Option<&ByteArray>
If the value is ByteArray, returns associated value. Returns None otherwise.