Morph

Trait Morph 

Source
pub trait Morph<T> {
    // Required method
    fn morph(from: T) -> Self;
}
Expand description

Artificial trait implemented for a few types like AMQPValue or ShortString to allow infallibly morphing (instantiating) them from standard Rust types.

Required Methods§

Source

fn morph(from: T) -> Self

Flexibly generates an instance of Self from a value of type T.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Morph<&str> for AMQPValue

Source§

fn morph(from: &str) -> Self

Source§

impl Morph<&str> for ShortString

Source§

fn morph(from: &str) -> Self

Source§

impl Morph<bool> for AMQPValue

Source§

fn morph(from: bool) -> Self

Source§

impl Morph<bool> for ShortString

Source§

fn morph(from: bool) -> Self

Source§

impl Morph<f32> for AMQPValue

Source§

fn morph(from: f32) -> Self

Source§

impl Morph<f32> for ShortString

Source§

fn morph(from: f32) -> Self

Source§

impl Morph<f64> for AMQPValue

Source§

fn morph(from: f64) -> Self

Source§

impl Morph<f64> for ShortString

Source§

fn morph(from: f64) -> Self

Source§

impl Morph<i8> for AMQPValue

Source§

fn morph(from: i8) -> Self

Source§

impl Morph<i8> for ShortString

Source§

fn morph(from: i8) -> Self

Source§

impl Morph<i16> for AMQPValue

Source§

fn morph(from: i16) -> Self

Source§

impl Morph<i16> for ShortString

Source§

fn morph(from: i16) -> Self

Source§

impl Morph<i32> for AMQPValue

Source§

fn morph(from: i32) -> Self

Source§

impl Morph<i32> for ShortString

Source§

fn morph(from: i32) -> Self

Source§

impl Morph<i64> for AMQPValue

Source§

fn morph(from: i64) -> Self

Source§

impl Morph<i64> for ShortString

Source§

fn morph(from: i64) -> Self

Source§

impl Morph<isize> for AMQPValue

Source§

fn morph(from: isize) -> Self

Source§

impl Morph<isize> for ShortString

Source§

fn morph(from: isize) -> Self

Source§

impl Morph<u8> for AMQPValue

Source§

fn morph(from: u8) -> Self

Source§

impl Morph<u8> for ShortString

Source§

fn morph(from: u8) -> Self

Source§

impl Morph<u16> for AMQPValue

Source§

fn morph(from: u16) -> Self

Source§

impl Morph<u16> for ShortString

Source§

fn morph(from: u16) -> Self

Source§

impl Morph<u32> for AMQPValue

Source§

fn morph(from: u32) -> Self

Source§

impl Morph<u32> for ShortString

Source§

fn morph(from: u32) -> Self

Source§

impl Morph<u64> for AMQPValue

Source§

fn morph(from: u64) -> Self

Source§

impl Morph<u64> for ShortString

Source§

fn morph(from: u64) -> Self

Source§

impl Morph<usize> for AMQPValue

Source§

fn morph(from: usize) -> Self

Source§

impl Morph<usize> for ShortString

Source§

fn morph(from: usize) -> Self

Source§

impl Morph<String> for AMQPValue

Source§

fn morph(from: String) -> Self

Source§

impl Morph<String> for ShortString

Source§

fn morph(from: String) -> Self

Implementors§