Coerce

Trait Coerce 

Source
pub trait Coerce<'a, T> {
    // Required method
    fn coerce(&'a self) -> Option<T>;
}
Expand description

Artificial trait implemented for a few types like AMQPValue or ShortString to allow conveniently coercing them into standard Rust types.

Required Methods§

Source

fn coerce(&'a self) -> Option<T>

Flexibly generates a value of type T that is inferred from this object.

Implementations on Foreign Types§

Source§

impl Coerce<'_, bool> for AMQPValue

Source§

fn coerce(&self) -> Option<bool>

Source§

impl Coerce<'_, bool> for ByteArray

Source§

fn coerce(&self) -> Option<bool>

Source§

impl Coerce<'_, bool> for LongString

Source§

fn coerce(&self) -> Option<bool>

Source§

impl Coerce<'_, bool> for ShortString

Source§

fn coerce(&self) -> Option<bool>

Source§

impl Coerce<'_, f32> for AMQPValue

Source§

fn coerce(&self) -> Option<f32>

Source§

impl Coerce<'_, f32> for ByteArray

Source§

fn coerce(&self) -> Option<f32>

Source§

impl Coerce<'_, f32> for LongString

Source§

fn coerce(&self) -> Option<f32>

Source§

impl Coerce<'_, f32> for ShortString

Source§

fn coerce(&self) -> Option<f32>

Source§

impl Coerce<'_, f64> for AMQPValue

Source§

fn coerce(&self) -> Option<f64>

Source§

impl Coerce<'_, f64> for ByteArray

Source§

fn coerce(&self) -> Option<f64>

Source§

impl Coerce<'_, f64> for LongString

Source§

fn coerce(&self) -> Option<f64>

Source§

impl Coerce<'_, f64> for ShortString

Source§

fn coerce(&self) -> Option<f64>

Source§

impl Coerce<'_, i8> for AMQPValue

Source§

fn coerce(&self) -> Option<i8>

Source§

impl Coerce<'_, i8> for ByteArray

Source§

fn coerce(&self) -> Option<i8>

Source§

impl Coerce<'_, i8> for LongString

Source§

fn coerce(&self) -> Option<i8>

Source§

impl Coerce<'_, i8> for ShortString

Source§

fn coerce(&self) -> Option<i8>

Source§

impl Coerce<'_, i16> for AMQPValue

Source§

fn coerce(&self) -> Option<i16>

Source§

impl Coerce<'_, i16> for ByteArray

Source§

fn coerce(&self) -> Option<i16>

Source§

impl Coerce<'_, i16> for LongString

Source§

fn coerce(&self) -> Option<i16>

Source§

impl Coerce<'_, i16> for ShortString

Source§

fn coerce(&self) -> Option<i16>

Source§

impl Coerce<'_, i32> for AMQPValue

Source§

fn coerce(&self) -> Option<i32>

Source§

impl Coerce<'_, i32> for ByteArray

Source§

fn coerce(&self) -> Option<i32>

Source§

impl Coerce<'_, i32> for LongString

Source§

fn coerce(&self) -> Option<i32>

Source§

impl Coerce<'_, i32> for ShortString

Source§

fn coerce(&self) -> Option<i32>

Source§

impl Coerce<'_, i64> for AMQPValue

Source§

fn coerce(&self) -> Option<i64>

Source§

impl Coerce<'_, i64> for ByteArray

Source§

fn coerce(&self) -> Option<i64>

Source§

impl Coerce<'_, i64> for LongString

Source§

fn coerce(&self) -> Option<i64>

Source§

impl Coerce<'_, i64> for ShortString

Source§

fn coerce(&self) -> Option<i64>

Source§

impl Coerce<'_, isize> for AMQPValue

Source§

impl Coerce<'_, isize> for ByteArray

Source§

impl Coerce<'_, isize> for LongString

Source§

impl Coerce<'_, isize> for ShortString

Source§

impl Coerce<'_, u8> for AMQPValue

Source§

fn coerce(&self) -> Option<u8>

Source§

impl Coerce<'_, u8> for ByteArray

Source§

fn coerce(&self) -> Option<u8>

Source§

impl Coerce<'_, u8> for LongString

Source§

fn coerce(&self) -> Option<u8>

Source§

impl Coerce<'_, u8> for ShortString

Source§

fn coerce(&self) -> Option<u8>

Source§

impl Coerce<'_, u16> for AMQPValue

Source§

fn coerce(&self) -> Option<u16>

Source§

impl Coerce<'_, u16> for ByteArray

Source§

fn coerce(&self) -> Option<u16>

Source§

impl Coerce<'_, u16> for LongString

Source§

fn coerce(&self) -> Option<u16>

Source§

impl Coerce<'_, u16> for ShortString

Source§

fn coerce(&self) -> Option<u16>

Source§

impl Coerce<'_, u32> for AMQPValue

Source§

fn coerce(&self) -> Option<u32>

Source§

impl Coerce<'_, u32> for ByteArray

Source§

fn coerce(&self) -> Option<u32>

Source§

impl Coerce<'_, u32> for LongString

Source§

fn coerce(&self) -> Option<u32>

Source§

impl Coerce<'_, u32> for ShortString

Source§

fn coerce(&self) -> Option<u32>

Source§

impl Coerce<'_, u64> for AMQPValue

Source§

fn coerce(&self) -> Option<u64>

Source§

impl Coerce<'_, u64> for ByteArray

Source§

fn coerce(&self) -> Option<u64>

Source§

impl Coerce<'_, u64> for LongString

Source§

fn coerce(&self) -> Option<u64>

Source§

impl Coerce<'_, u64> for ShortString

Source§

fn coerce(&self) -> Option<u64>

Source§

impl Coerce<'_, usize> for AMQPValue

Source§

impl Coerce<'_, usize> for ByteArray

Source§

impl Coerce<'_, usize> for LongString

Source§

impl Coerce<'_, usize> for ShortString

Source§

impl Coerce<'_, String> for AMQPValue

Source§

impl Coerce<'_, String> for ByteArray

Source§

impl Coerce<'_, String> for LongString

Source§

impl Coerce<'_, String> for ShortString

Source§

impl<'a> Coerce<'a, &'a str> for AMQPValue

Source§

fn coerce(&'a self) -> Option<&'a str>

Source§

impl<'a> Coerce<'a, &'a str> for ShortString

Source§

fn coerce(&'a self) -> Option<&'a str>

Implementors§