[][src]Struct amiquip::Queue

pub struct Queue<'a> { /* fields omitted */ }

Handle for a declared AMQP queue.

Methods

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

pub fn name(&self) -> &str[src]

Name of the declared queue. Normally this is the name specified when you declare the queue; however, if you declare a queue with an empty name, the server will assign an autogenerated queue name.

pub fn declared_message_count(&self) -> Option<u32>[src]

Count of messages in the queue at the time when the queue was declared.

This will be Some(count) if the queue was declared via Channel::queue_declare or Channel::queue_declare_passive, and will be None if the queue was declared via Channel::queue_declare_nowait.

pub fn declared_consumer_count(&self) -> Option<u32>[src]

Count of consumers on the queue queue at the time when the queue was declared.

This will be Some(count) if the queue was declared via Channel::queue_declare or Channel::queue_declare_passive, and will be None if the queue was declared via Channel::queue_declare_nowait.

pub fn get(&self, no_ack: bool) -> Result<Option<Get>>[src]

Synchronously get a single message from the queue.

On success, returns Some(message) if there was a message in the queue or None if there were no messages in the queue. If no_ack is false, you are responsible for acknowledging the returned message, typically via Get::ack.

Prefer using consume to allow the server to push messages to you on demand instead of polling with get.

pub fn consume(&self, options: ConsumerOptions) -> Result<Consumer<'a>>[src]

Synchronously start a consumer on this queue.

pub fn bind<S: Into<String>>(
    &self,
    exchange: &Exchange,
    routing_key: S,
    arguments: FieldTable
) -> Result<()>
[src]

Synchronously bind this queue to an exchange with the given routing key. arguments are typically optional, and are plugin / server dependent.

pub fn bind_nowait<S: Into<String>>(
    &self,
    exchange: &Exchange,
    routing_key: S,
    arguments: FieldTable
) -> Result<()>
[src]

Asynchronously bind this queue to an exchange with the given routing key. arguments are typically optional, and are plugin / server dependent.

pub fn unbind<S: Into<String>>(
    &self,
    exchange: &Exchange,
    routing_key: S,
    arguments: FieldTable
) -> Result<()>
[src]

Synchronously unbind this queue from an exchange with the given routing key. arguments are typically optional, and are plugin / server dependent.

pub fn purge(&self) -> Result<u32>[src]

Synchronously purge all messages from this queue. On success, returns the number of messages that were purged.

pub fn purge_nowait(&self) -> Result<()>[src]

Asynchronously purge all messages from this queue.

pub fn delete(self, options: QueueDeleteOptions) -> Result<u32>[src]

Synchronously delete this queue. On success, returns the number of messages that were in the queue when it was deleted.

pub fn delete_nowait(self, options: QueueDeleteOptions) -> Result<()>[src]

Asynchronously delete this queue.

Auto Trait Implementations

impl<'a> !Send for Queue<'a>

impl<'a> !Sync for Queue<'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.