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
sourceimpl 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.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for AMQPValue
impl<'de> Deserialize<'de> for AMQPValue
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<DecimalValue> for AMQPValue
impl From<DecimalValue> for AMQPValue
sourcefn from(v: DecimalValue) -> Self
fn from(v: DecimalValue) -> Self
Performs the conversion.
sourceimpl From<FieldArray> for AMQPValue
impl From<FieldArray> for AMQPValue
sourcefn from(v: FieldArray) -> Self
fn from(v: FieldArray) -> Self
Performs the conversion.
sourceimpl From<FieldTable> for AMQPValue
impl From<FieldTable> for AMQPValue
sourcefn from(v: FieldTable) -> Self
fn from(v: FieldTable) -> Self
Performs the conversion.
sourceimpl From<LongString> for AMQPValue
impl From<LongString> for AMQPValue
sourcefn from(v: LongString) -> Self
fn from(v: LongString) -> Self
Performs the conversion.
sourceimpl From<ShortString> for AMQPValue
impl From<ShortString> for AMQPValue
sourcefn from(v: ShortString) -> Self
fn from(v: ShortString) -> Self
Performs the conversion.
impl StructuralPartialEq for AMQPValue
Auto Trait Implementations
impl RefUnwindSafe for AMQPValue
impl Send for AMQPValue
impl Sync for AMQPValue
impl Unpin for AMQPValue
impl UnwindSafe for AMQPValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more