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

source

pub fn get_type(&self) -> AMQPType

Get the AMQPType of an AMQPValue

source

pub fn try_from(value: &Value, amqp_type: AMQPType) -> Option<AMQPValue>

Convert a serde_json::Value into an AMQPValue

source

pub fn as_bool(&self) -> Option<Boolean>

If the value is bool, returns associated value. Returns None otherwise.

source

pub fn as_short_short_int(&self) -> Option<ShortShortInt>

If the value is ShortShortInt, returns associated value. Returns None otherwise.

source

pub fn as_short_short_uint(&self) -> Option<ShortShortUInt>

If the value is ShortShortUInt, returns associated value. Returns None otherwise.

source

pub fn as_short_int(&self) -> Option<ShortInt>

If the value is ShortInt, returns associated value. Returns None otherwise.

source

pub fn as_short_uint(&self) -> Option<ShortUInt>

If the value is ShortUInt, returns associated value. Returns None otherwise.

source

pub fn as_long_int(&self) -> Option<LongInt>

If the value is LongInt, returns associated value. Returns None otherwise.

source

pub fn as_long_uint(&self) -> Option<LongUInt>

If the value is LongUInt, returns associated value. Returns None otherwise.

source

pub fn as_long_long_int(&self) -> Option<LongLongInt>

If the value is LongLongInt, returns associated value. Returns None otherwise.

source

pub fn as_float(&self) -> Option<Float>

If the value is Float, returns associated value. Returns None otherwise.

source

pub fn as_double(&self) -> Option<Double>

If the value is Double, returns associated value. Returns None otherwise.

source

pub fn as_decimal_value(&self) -> Option<DecimalValue>

If the value is DecimalValue, returns associated value. Returns None otherwise.

source

pub fn as_short_string(&self) -> Option<&ShortString>

If the value is ShortString, returns associated value as str. Returns None otherwise.

source

pub fn as_long_string(&self) -> Option<&LongString>

If the value is LongString, returns associated value as bytes. Returns None otherwise.

source

pub fn as_array(&self) -> Option<&FieldArray>

If the value is FieldArray, returns associated value. Returns None otherwise.

source

pub fn as_timestamp(&self) -> Option<Timestamp>

If the value is Timestamp, returns associated value. Returns None otherwise.

source

pub fn as_field_table(&self) -> Option<&FieldTable>

If the value is FieldTable, returns associated value. Returns None otherwise.

source

pub fn as_byte_array(&self) -> Option<&ByteArray>

If the value is ByteArray, returns associated value. Returns None otherwise.

source

pub fn as_void(&self) -> Option<()>

Returns true if value is Void.

Trait Implementations§

source§

impl Clone for AMQPValue

source§

fn clone(&self) -> AMQPValue

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 AMQPValue

source§

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

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

impl<'de> Deserialize<'de> for AMQPValue

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<ByteArray> for AMQPValue

source§

fn from(v: ByteArray) -> Self

Converts to this type from the input type.
source§

impl From<DecimalValue> for AMQPValue

source§

fn from(v: DecimalValue) -> Self

Converts to this type from the input type.
source§

impl From<FieldArray> for AMQPValue

source§

fn from(v: FieldArray) -> Self

Converts to this type from the input type.
source§

impl From<FieldTable> for AMQPValue

source§

fn from(v: FieldTable) -> Self

Converts to this type from the input type.
source§

impl From<LongString> for AMQPValue

source§

fn from(v: LongString) -> Self

Converts to this type from the input type.
source§

impl From<ShortString> for AMQPValue

source§

fn from(v: ShortString) -> Self

Converts to this type from the input type.
source§

impl From<bool> for AMQPValue

source§

fn from(v: Boolean) -> Self

Converts to this type from the input type.
source§

impl From<f32> for AMQPValue

source§

fn from(v: Float) -> Self

Converts to this type from the input type.
source§

impl From<f64> for AMQPValue

source§

fn from(v: Double) -> Self

Converts to this type from the input type.
source§

impl From<i16> for AMQPValue

source§

fn from(v: ShortInt) -> Self

Converts to this type from the input type.
source§

impl From<i32> for AMQPValue

source§

fn from(v: LongInt) -> Self

Converts to this type from the input type.
source§

impl From<i64> for AMQPValue

source§

fn from(v: LongLongInt) -> Self

Converts to this type from the input type.
source§

impl From<i8> for AMQPValue

source§

fn from(v: ShortShortInt) -> Self

Converts to this type from the input type.
source§

impl From<u16> for AMQPValue

source§

fn from(v: ShortUInt) -> Self

Converts to this type from the input type.
source§

impl From<u32> for AMQPValue

source§

fn from(v: LongUInt) -> Self

Converts to this type from the input type.
source§

impl From<u64> for AMQPValue

source§

fn from(v: Timestamp) -> Self

Converts to this type from the input type.
source§

impl From<u8> for AMQPValue

source§

fn from(v: ShortShortUInt) -> Self

Converts to this type from the input type.
source§

impl PartialEq for AMQPValue

source§

fn eq(&self, other: &AMQPValue) -> 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 Serialize for AMQPValue

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 StructuralPartialEq for AMQPValue

Auto Trait Implementations§

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
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>,