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 + Sync + Send + 'static> Channel<T>
[src]
fn create(
transport: Arc<Mutex<AMQPTransport<T>>>
) -> Box<Future<Item = Self, Error = Error>>
transport: Arc<Mutex<AMQPTransport<T>>>
) -> Box<Future<Item = Self, Error = Error>>
create a channel
fn access_request(
&self,
realm: &str,
options: &AccessRequestOptions
) -> Box<Future<Item = (), Error = Error>>
&self,
realm: &str,
options: &AccessRequestOptions
) -> Box<Future<Item = (), Error = Error>>
request access
returns a future that resolves once the access is granted
fn exchange_declare(
&self,
name: &str,
exchange_type: &str,
options: &ExchangeDeclareOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error>>
&self,
name: &str,
exchange_type: &str,
options: &ExchangeDeclareOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error>>
declares an exchange
returns a future that resolves once the exchange is available
fn exchange_delete(
&self,
name: &str,
options: &ExchangeDeleteOptions
) -> Box<Future<Item = (), Error = Error>>
&self,
name: &str,
options: &ExchangeDeleteOptions
) -> Box<Future<Item = (), Error = Error>>
deletes an exchange
returns a future that resolves once the exchange is deleted
fn exchange_bind(
&self,
destination: &str,
source: &str,
routing_key: &str,
options: &ExchangeBindOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error>>
&self,
destination: &str,
source: &str,
routing_key: &str,
options: &ExchangeBindOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error>>
binds an exchange to another exchange
returns a future that resolves once the exchanges are bound
fn exchange_unbind(
&self,
destination: &str,
source: &str,
routing_key: &str,
options: &ExchangeUnbindOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error>>
&self,
destination: &str,
source: &str,
routing_key: &str,
options: &ExchangeUnbindOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error>>
unbinds an exchange from another one
returns a future that resolves once the exchanges are unbound
fn queue_declare(
&self,
name: &str,
options: &QueueDeclareOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error>>
&self,
name: &str,
options: &QueueDeclareOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error>>
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
fn queue_bind(
&self,
name: &str,
exchange: &str,
routing_key: &str,
options: &QueueBindOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error>>
&self,
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,
options: &ConfirmSelectOptions
) -> Box<Future<Item = (), Error = Error>>
&self,
options: &ConfirmSelectOptions
) -> Box<Future<Item = (), Error = Error>>
sets up confirm extension for this channel
fn basic_publish(
&self,
exchange: &str,
queue: &str,
payload: &[u8],
options: &BasicPublishOptions,
properties: BasicProperties
) -> Box<Future<Item = Option<bool>, Error = Error>>
&self,
exchange: &str,
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,
arguments: &FieldTable
) -> Box<Future<Item = Consumer<T>, Error = Error>>
&self,
queue: &str,
consumer_tag: &str,
options: &BasicConsumeOptions,
arguments: &FieldTable
) -> 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>>
&self,
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>>
&self,
queue: &str,
options: &BasicGetOptions
) -> Box<Future<Item = Message, Error = Error>>
gets a message
fn queue_purge(
&self,
queue_name: &str,
options: &QueuePurgeOptions
) -> Box<Future<Item = (), Error = Error>>
&self,
queue_name: &str,
options: &QueuePurgeOptions
) -> 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>>
&self,
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: &str
) -> Box<Future<Item = (), Error = Error>>
&self,
code: u16,
message: &str
) -> Box<Future<Item = (), Error = Error>>
closes the cannel
fn wait_for_answer<Finished>(
transport: Arc<Mutex<AMQPTransport<T>>>,
request_id: RequestId,
finished: Finished
) -> Box<Future<Item = Option<bool>, Error = Error>> where
Finished: 'static + Fn(&mut Connection, RequestId) -> Poll<Option<bool>, Error>,
transport: Arc<Mutex<AMQPTransport<T>>>,
request_id: RequestId,
finished: Finished
) -> Box<Future<Item = Option<bool>, Error = Error>> where
Finished: 'static + Fn(&mut Connection, RequestId) -> Poll<Option<bool>, Error>,
internal method to wait until a request succeeds
Trait Implementations
impl<T> Clone for Channel<T> where
T: Sync + Send,
[src]
T: Sync + Send,
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