[][src]Struct amiquip::Publish

pub struct Publish<'a> {
    pub body: &'a [u8],
    pub routing_key: String,
    pub mandatory: bool,
    pub immediate: bool,
    pub properties: AmqpProperties,
}

Wrapper for a message to be published.

Fields

body: &'a [u8]

Body of content to send.

routing_key: String

Routing key.

mandatory: bool

If true, return this message to us if it cannot be routed to a queue. See Channel::listen_for_returns for receiving returned messages.

immediate: bool

If true, return this message to us if it cannot immediately be routed to a consumer. See Channel::listen_for_returns for receiving returned messages.

properties: AmqpProperties

Other properties of the message (e.g., headers).

Methods

impl<'a> Publish<'a>[src]

pub fn new<S: Into<String>>(body: &[u8], routing_key: S) -> Publish[src]

Helper to create a message with the given body and routing key; mandatory and immediate will be set to false, and properties will be empty.

pub fn with_properties<S: Into<String>>(
    body: &[u8],
    routing_key: S,
    properties: AmqpProperties
) -> Publish
[src]

Helper to create a message with the given body, routing key, and properties; mandatory and immediate will be set to false.

Auto Trait Implementations

impl<'a> Send for Publish<'a>

impl<'a> Sync for Publish<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.