Struct lapin::Channel

source ·
pub struct Channel { /* private fields */ }
Expand description

Main entry point for most AMQP operations.

It serves as a lightweight connection and can be obtained from a Connection by calling Connection::create_channel.

See also the RabbitMQ documentation on channels.

Implementations§

source§

impl Channel

source

pub fn status(&self) -> &ChannelStatus

source

pub fn on_error<E: FnMut(Error) + Send + 'static>(&self, handler: E)

source

pub fn id(&self) -> ChannelId

source

pub async fn close(&self, reply_code: ReplyCode, reply_text: &str) -> Result<()>

source

pub async fn basic_consume( &self, queue: &str, consumer_tag: &str, options: BasicConsumeOptions, arguments: FieldTable ) -> Result<Consumer>

source

pub async fn basic_get( &self, queue: &str, options: BasicGetOptions ) -> Result<Option<BasicGetMessage>>

source

pub async fn exchange_declare( &self, exchange: &str, kind: ExchangeKind, options: ExchangeDeclareOptions, arguments: FieldTable ) -> Result<()>

source

pub async fn wait_for_confirms(&self) -> Result<Vec<BasicReturnMessage>>

source§

impl Channel

source

pub async fn basic_qos( &self, prefetch_count: ShortUInt, options: BasicQosOptions ) -> Result<()>

source

pub async fn basic_cancel( &self, consumer_tag: &str, options: BasicCancelOptions ) -> Result<()>

source

pub async fn basic_publish( &self, exchange: &str, routing_key: &str, options: BasicPublishOptions, payload: &[u8], properties: BasicProperties ) -> Result<PublisherConfirm>

source

pub async fn basic_ack( &self, delivery_tag: LongLongUInt, options: BasicAckOptions ) -> Result<()>

source

pub async fn basic_reject( &self, delivery_tag: LongLongUInt, options: BasicRejectOptions ) -> Result<()>

source

pub async fn basic_recover_async( &self, options: BasicRecoverAsyncOptions ) -> Result<()>

source

pub async fn basic_recover(&self, options: BasicRecoverOptions) -> Result<()>

source

pub async fn basic_nack( &self, delivery_tag: LongLongUInt, options: BasicNackOptions ) -> Result<()>

source

pub async fn channel_flow(&self, options: ChannelFlowOptions) -> Result<Boolean>

source

pub async fn access_request( &self, realm: &str, options: AccessRequestOptions ) -> Result<()>

source

pub async fn exchange_delete( &self, exchange: &str, options: ExchangeDeleteOptions ) -> Result<()>

Delete an exchange

source

pub async fn exchange_bind( &self, destination: &str, source: &str, routing_key: &str, options: ExchangeBindOptions, arguments: FieldTable ) -> Result<()>

source

pub async fn exchange_unbind( &self, destination: &str, source: &str, routing_key: &str, options: ExchangeUnbindOptions, arguments: FieldTable ) -> Result<()>

source

pub async fn queue_declare( &self, queue: &str, options: QueueDeclareOptions, arguments: FieldTable ) -> Result<Queue>

source

pub async fn queue_bind( &self, queue: &str, exchange: &str, routing_key: &str, options: QueueBindOptions, arguments: FieldTable ) -> Result<()>

source

pub async fn queue_purge( &self, queue: &str, options: QueuePurgeOptions ) -> Result<MessageCount>

source

pub async fn queue_delete( &self, queue: &str, options: QueueDeleteOptions ) -> Result<MessageCount>

source

pub async fn queue_unbind( &self, queue: &str, exchange: &str, routing_key: &str, arguments: FieldTable ) -> Result<()>

source

pub async fn tx_select(&self) -> Result<()>

source

pub async fn tx_commit(&self) -> Result<()>

source

pub async fn tx_rollback(&self) -> Result<()>

source

pub async fn confirm_select(&self, options: ConfirmSelectOptions) -> Result<()>

Trait Implementations§

source§

impl Clone for Channel

source§

fn clone(&self) -> Channel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Channel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Channel

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

source§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more