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 + Send + 'static> Channel<T>
[src]
pub fn create(
transport: Arc<Mutex<AMQPTransport<T>>>
) -> Box<Future<Item = Self, Error = Error> + Send>
[src]
transport: Arc<Mutex<AMQPTransport<T>>>
) -> Box<Future<Item = Self, Error = Error> + Send>
create a channel
pub fn access_request(
&self,
realm: &str,
options: &AccessRequestOptions
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
realm: &str,
options: &AccessRequestOptions
) -> Box<Future<Item = (), Error = Error> + Send>
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
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
name: &str,
exchange_type: &str,
options: &ExchangeDeclareOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error> + Send>
declares an exchange
returns a future that resolves once the exchange is available
pub fn exchange_delete(
&self,
name: &str,
options: &ExchangeDeleteOptions
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
name: &str,
options: &ExchangeDeleteOptions
) -> Box<Future<Item = (), Error = Error> + Send>
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
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
destination: &str,
source: &str,
routing_key: &str,
options: &ExchangeBindOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error> + Send>
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
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
destination: &str,
source: &str,
routing_key: &str,
options: &ExchangeUnbindOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error> + Send>
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
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
name: &str,
options: &QueueDeclareOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error> + Send>
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
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
name: &str,
exchange: &str,
routing_key: &str,
options: &QueueBindOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error> + Send>
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
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
name: &str,
exchange: &str,
routing_key: &str,
options: &QueueUnbindOptions,
arguments: &FieldTable
) -> Box<Future<Item = (), Error = Error> + Send>
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
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
options: &ConfirmSelectOptions
) -> Box<Future<Item = (), Error = Error> + Send>
sets up confirm extension for this channel
pub fn basic_qos(
&self,
options: &BasicQosOptions
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
options: &BasicQosOptions
) -> Box<Future<Item = (), Error = Error> + Send>
specifies quality of service for a channel
pub fn basic_publish(
&self,
exchange: &str,
routing_key: &str,
payload: &[u8],
options: &BasicPublishOptions,
properties: BasicProperties
) -> Box<Future<Item = Option<bool>, Error = Error> + Send>
[src]
&self,
exchange: &str,
routing_key: &str,
payload: &[u8],
options: &BasicPublishOptions,
properties: BasicProperties
) -> Box<Future<Item = Option<bool>, Error = Error> + Send>
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'dSome(false)
if we're on a confirm channel and the message was nack'dNone
if we're not on a confirm channel
pub fn basic_consume(
&self,
queue: &str,
consumer_tag: &str,
options: &BasicConsumeOptions,
arguments: &FieldTable
) -> Box<Future<Item = Consumer<T>, Error = Error> + Send>
[src]
&self,
queue: &str,
consumer_tag: &str,
options: &BasicConsumeOptions,
arguments: &FieldTable
) -> Box<Future<Item = Consumer<T>, Error = Error> + Send>
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
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
delivery_tag: u64
) -> Box<Future<Item = (), Error = Error> + Send>
acks a message
pub fn basic_nack(
&self,
delivery_tag: u64,
requeue: bool
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
delivery_tag: u64,
requeue: bool
) -> Box<Future<Item = (), Error = Error> + Send>
nacks a message
pub fn basic_reject(
&self,
delivery_tag: u64,
requeue: bool
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
delivery_tag: u64,
requeue: bool
) -> Box<Future<Item = (), Error = Error> + Send>
rejects a message
pub fn basic_get(
&self,
queue: &str,
options: &BasicGetOptions
) -> Box<Future<Item = BasicGetMessage, Error = Error> + Send>
[src]
&self,
queue: &str,
options: &BasicGetOptions
) -> Box<Future<Item = BasicGetMessage, Error = Error> + Send>
gets a message
pub fn queue_purge(
&self,
queue_name: &str,
options: &QueuePurgeOptions
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
queue_name: &str,
options: &QueuePurgeOptions
) -> Box<Future<Item = (), Error = Error> + Send>
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
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
queue_name: &str,
options: &QueueDeleteOptions
) -> Box<Future<Item = (), Error = Error> + Send>
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
) -> Box<Future<Item = (), Error = Error> + Send>
[src]
&self,
code: u16,
message: &str
) -> Box<Future<Item = (), Error = Error> + Send>
closes the cannel
pub fn wait_for_answer<Finished>(
transport: Arc<Mutex<AMQPTransport<T>>>,
request_id: RequestId,
finished: Finished
) -> Box<Future<Item = Option<bool>, Error = Error> + Send> where
Finished: 'static + Send + Fn(&mut Connection, RequestId) -> Poll<Option<bool>, Error>,
[src]
transport: Arc<Mutex<AMQPTransport<T>>>,
request_id: RequestId,
finished: Finished
) -> Box<Future<Item = Option<bool>, Error = Error> + Send> where
Finished: 'static + Send + Fn(&mut Connection, RequestId) -> Poll<Option<bool>, Error>,
internal method to wait until a request succeeds