[][src]Struct lapin_futures::channel::Channel

pub struct Channel<T> {
    pub transport: Arc<Mutex<AMQPTransport<T>>>,
    pub id: u16,
}

Channel provides methods to act on a channel, such as managing queues

Fields

transport: Arc<Mutex<AMQPTransport<T>>>id: u16

Methods

impl<T: AsyncRead + AsyncWrite + Send + Sync + 'static> Channel<T>[src]

pub fn create(
    transport: Arc<Mutex<AMQPTransport<T>>>
) -> impl Future<Item = Self, Error = Error> + Send + 'static
[src]

create a channel

pub fn access_request(
    &self,
    realm: &str,
    options: AccessRequestOptions
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

request access

returns a future that resolves once the access is granted

pub fn exchange_declare(
    &self,
    name: &str,
    exchange_type: &str,
    options: ExchangeDeclareOptions,
    arguments: FieldTable
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

declares an exchange

returns a future that resolves once the exchange is available

pub fn exchange_delete(
    &self,
    name: &str,
    options: ExchangeDeleteOptions
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

deletes an exchange

returns a future that resolves once the exchange is deleted

pub fn exchange_bind(
    &self,
    destination: &str,
    source: &str,
    routing_key: &str,
    options: ExchangeBindOptions,
    arguments: FieldTable
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

binds an exchange to another exchange

returns a future that resolves once the exchanges are bound

pub fn exchange_unbind(
    &self,
    destination: &str,
    source: &str,
    routing_key: &str,
    options: ExchangeUnbindOptions,
    arguments: FieldTable
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

unbinds an exchange from another one

returns a future that resolves once the exchanges are unbound

pub fn queue_declare(
    &self,
    name: &str,
    options: QueueDeclareOptions,
    arguments: FieldTable
) -> impl Future<Item = Queue, Error = Error> + Send + 'static
[src]

declares a queue

returns a future that resolves once the queue is available

the mandatory and ìmmediate options can be set to true, but the return message will not be handled

pub fn queue_bind(
    &self,
    name: &str,
    exchange: &str,
    routing_key: &str,
    options: QueueBindOptions,
    arguments: FieldTable
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

binds a queue to an exchange

returns a future that resolves once the queue is bound to the exchange

pub fn queue_unbind(
    &self,
    name: &str,
    exchange: &str,
    routing_key: &str,
    options: QueueUnbindOptions,
    arguments: FieldTable
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

unbinds a queue from the exchange

returns a future that resolves once the queue is unbound from the exchange

pub fn confirm_select(
    &self,
    options: ConfirmSelectOptions
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

sets up confirm extension for this channel

pub fn basic_qos(
    &self,
    options: BasicQosOptions
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

specifies quality of service for a channel

pub fn basic_publish(
    &self,
    exchange: &str,
    routing_key: &str,
    payload: Vec<u8>,
    options: BasicPublishOptions,
    properties: BasicProperties
) -> impl Future<Item = Option<RequestId>, Error = Error> + Send + 'static
[src]

publishes a message on a queue

the future's result is:

  • Some(request_id) if we're on a confirm channel and the message was ack'd
  • None if we're not on a confirm channel or the message was nack'd

pub fn basic_consume(
    &self,
    queue: &Queue,
    consumer_tag: &str,
    options: BasicConsumeOptions,
    arguments: FieldTable
) -> impl Future<Item = Consumer<T>, Error = Error> + Send + 'static
[src]

creates a consumer stream

returns a future of a Consumer that resolves once the method succeeds

Consumer implements futures::Stream, so it can be used with any of the usual combinators

pub fn basic_ack(
    &self,
    delivery_tag: u64,
    multiple: bool
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

acks a message

pub fn basic_nack(
    &self,
    delivery_tag: u64,
    multiple: bool,
    requeue: bool
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

nacks a message

pub fn basic_reject(
    &self,
    delivery_tag: u64,
    requeue: bool
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

rejects a message

pub fn basic_get(
    &self,
    queue: &str,
    options: BasicGetOptions
) -> impl Future<Item = BasicGetMessage, Error = Error> + Send + 'static
[src]

gets a message

pub fn queue_purge(
    &self,
    queue_name: &str,
    options: QueuePurgeOptions
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

Purge a queue.

This method removes all messages from a queue which are not awaiting acknowledgment.

pub fn queue_delete(
    &self,
    queue_name: &str,
    options: QueueDeleteOptions
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

Delete a queue.

This method deletes a queue. When a queue is deleted any pending messages are sent to a dead-letter queue if this is defined in the server configuration, and all consumers on the queue are cancelled.

If if_unused is set, the server will only delete the queue if it has no consumers. If the queue has consumers the server does not delete it but raises a channel exception instead.

If if_empty is set, the server will only delete the queue if it has no messages.

pub fn close(
    &self,
    code: u16,
    message: &str
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

closes the channel

pub fn close_ok(
    &self
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

ack a channel close

pub fn channel_flow(
    &self,
    options: ChannelFlowOptions
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

update a channel flow

pub fn channel_flow_ok(
    &self,
    options: ChannelFlowOptions
) -> impl Future<Item = (), Error = Error> + Send + 'static
[src]

ack an update to a channel flow

pub fn wait_for_answer<Finished>(
    tr: &mut AMQPTransport<T>,
    request_id: RequestId,
    finished: &Finished
) -> Poll<Option<RequestId>, Error> where
    Finished: 'static + Send + Fn(&mut Connection, RequestId) -> Poll<Option<RequestId>, Error>, 
[src]

internal method to wait until a request succeeds

Trait Implementations

impl<T> Clone for Channel<T> where
    T: Send
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<T> Send for Channel<T> where
    T: Send

impl<T> Sync for Channel<T> where
    T: Send

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T> Erased for T