Struct lapin_futures::channel::Channel
[−]
[src]
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 + 'static> Channel<T>
[src]
fn exchange_declare(&self,
name: &str,
exchange_type: &str,
options: &ExchangeDeclareOptions,
arguments: FieldTable)
-> Box<Future<Item=(), Error=Error>>
name: &str,
exchange_type: &str,
options: &ExchangeDeclareOptions,
arguments: FieldTable)
-> Box<Future<Item=(), Error=Error>>
creates an exchange
returns a future that resolves once the exchange is available
fn queue_declare(&self,
name: &str,
options: &QueueDeclareOptions,
arguments: FieldTable)
-> Box<Future<Item=(), Error=Error>>
name: &str,
options: &QueueDeclareOptions,
arguments: FieldTable)
-> Box<Future<Item=(), Error=Error>>
creates 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
fn queue_bind(&self,
name: &str,
exchange: &str,
routing_key: &str,
options: &QueueBindOptions,
arguments: FieldTable)
-> Box<Future<Item=(), Error=Error>>
name: &str,
exchange: &str,
routing_key: &str,
options: &QueueBindOptions,
arguments: FieldTable)
-> Box<Future<Item=(), Error=Error>>
binds a queue to an exchange
returns a future that resolves once the queue is bound to the exchange
fn confirm_select(&self) -> Box<Future<Item=(), Error=Error>>
sets up confirm extension for this channel
fn basic_publish(&self,
queue: &str,
payload: &[u8],
options: &BasicPublishOptions,
properties: BasicProperties)
-> Box<Future<Item=Option<bool>, Error=Error>>
queue: &str,
payload: &[u8],
options: &BasicPublishOptions,
properties: BasicProperties)
-> Box<Future<Item=Option<bool>, Error=Error>>
publishes a message on a queue
the future's result is:
- Some(true)
if we're on a confirm channel and the message was ack'd
- Some(false)
if we're on a confirm channel and the message was nack'd
- None
if we're not on a confirm channel
fn basic_consume(&self,
queue: &str,
consumer_tag: &str,
options: &BasicConsumeOptions)
-> Box<Future<Item=Consumer<T>, Error=Error>>
queue: &str,
consumer_tag: &str,
options: &BasicConsumeOptions)
-> Box<Future<Item=Consumer<T>, Error=Error>>
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
fn basic_ack(&self, delivery_tag: u64) -> Box<Future<Item=(), Error=Error>>
acks a message
fn basic_reject(&self,
delivery_tag: u64,
requeue: bool)
-> Box<Future<Item=(), Error=Error>>
delivery_tag: u64,
requeue: bool)
-> Box<Future<Item=(), Error=Error>>
rejects a message
fn basic_get(&self,
queue: &str,
options: &BasicGetOptions)
-> Box<Future<Item=Message, Error=Error>>
queue: &str,
options: &BasicGetOptions)
-> Box<Future<Item=Message, Error=Error>>
acks a message
fn queue_purge(&self, queue_name: &str) -> Box<Future<Item=(), Error=Error>>
Purge a queue.
This method removes all messages from a queue which are not awaiting acknowledgment.
fn queue_delete(&self,
queue_name: &str,
options: &QueueDeleteOptions)
-> Box<Future<Item=(), Error=Error>>
queue_name: &str,
options: &QueueDeleteOptions)
-> Box<Future<Item=(), Error=Error>>
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.
fn close(&self, code: u16, message: String) -> Box<Future<Item=(), Error=Error>>
closes the cannel
Trait Implementations
impl<T> Clone for Channel<T>
[src]
fn clone(&self) -> Channel<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more