PushHeader

Trait PushHeader 

Source
pub trait PushHeader<T> {
    // Required method
    fn push_header(self, key: &str, value: T) -> Self;
}
Expand description

Artificial trait implemented for AMQPProperties to allow conveniently inserting the header value by key, coercing it from various types.

Required Methods§

Source

fn push_header(self, key: &str, value: T) -> Self

Inserts the header value by key into these AMQPProperties, if it can be coerced from type T.

It is not recommended to use this for building up headers one key-value at a time, because this implementation clones the underlying FieldTable every time. Better to build a field table externally and then set it with a single call to with_headers.

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<T> PushHeader<T> for AMQPProperties
where AMQPValue: Morph<T>,

Implements PushHeader for every type T for which the underlying AMQPValue implements Morph.

Source§

fn push_header(self, key: &str, value: T) -> Self

Implementors§