pub async fn queue(
        &self,
        ex: &str,
        queue: &str,
        opts: QueueOptions,
    ) -> crate::Result<(lapin::Channel, lapin::Queue)> {
        let ch = self.0.create_channel().await.map_err(crate::Error::from)?;
        let q = ch
            .queue_declare(queue, opts.queue_opts, opts.queue_field)
            .await
            .map_err(crate::Error::from)?;
        if Self::is_default_exchange(ex) {
            // We don't need to bind to the exchange in case of the default
            // exchange.
            return Ok((ch, q));
        }
        ch.exchange_declare(ex, opts.kind, opts.ex_opts, opts.ex_field)
            .await
            .map_err(crate::Error::from)?;
        let routing_key = if Self::is_ephemeral_queue(queue) {
            q.name().as_str()
        } else {
            queue
        };
        ch.queue_bind(
            queue,
            ex,
            routing_key,
            opts.bind_opts.clone(),
            opts.bind_field.clone(),
        )
        .await
        .map_err(crate::Error::from)?;
        Ok((ch, q))
    }
/// queue creates a channel and a queue over the [Connection]
/// and returns the `Future<Output = <lapin::Channel, lapin::Queue>>`.
queue creates a channel and a queue over the [Connection]
and returns the `Future>`.
queue creates a channel and a queue over the [ Connection ] and returns the ` Future > ` .
pub async fn queue(
        &self,
        ex: &str,
        queue: &str,
        opts: QueueOptions,
    ) -> crate::Result<(lapin::Channel, lapin::Queue)> {
        let ch = self.0.create_channel().await.map_err(crate::Error::from)?;
        let q = ch
            .queue_declare(queue, opts.queue_opts, opts.queue_field)
            .await
            .map_err(crate::Error::from)?;
        if Self::is_default_exchange(ex) {
            // We don't need to bind to the exchange in case of the default
            // exchange.
            return Ok((ch, q));
        }
        ch.exchange_declare(ex, opts.kind, opts.ex_opts, opts.ex_field)
            .await
            .map_err(crate::Error::from)?;
        let routing_key = if Self::is_ephemeral_queue(queue) {
            q.name().as_str()
        } else {
            queue
        };
        ch.queue_bind(
            queue,
            ex,
            routing_key,
            opts.bind_opts.clone(),
            opts.bind_field.clone(),
        )
        .await
        .map_err(crate::Error::from)?;
        Ok((ch, q))
    }
pub async fn queue ( & self , ex : & str , queue : & str , opts : QueueOptions , ) -> crate :: Result < ( lapin :: Channel , lapin :: Queue ) > { let ch = self . 0 . create_channel ( ) . await . map_err ( crate :: Error :: from ) ? ; let q = ch . queue_declare ( queue , opts . queue_opts , opts . queue_field ) . await . map_err ( crate :: Error :: from ) ? ; if Self :: is_default_exchange ( ex ) { // We don't need to bind to the exchange in case of the default // exchange. return Ok ( ( ch , q ) ) ; } ch . exchange_declare ( ex , opts . kind , opts . ex_opts , opts . ex_field ) . await . map_err ( crate :: Error :: from ) ? ; let routing_key = if Self :: is_ephemeral_queue ( queue ) { q . name ( ) . as_str ( ) } else { queue } ; ch . queue_bind ( queue , ex , routing_key , opts . bind_opts . clone ( ) , opts . bind_field . clone ( ) , ) . await . map_err ( crate :: Error :: from ) ? ; Ok ( ( ch , q ) ) }
queue creates a channel and a queue over the [Connection]
and returns the `Future<Output = <lapin::Channel, lapin::Queue>>`.
queue creates a channel and a queue over the [ Connection ] and returns the ` Future<Output = <lapin :: Channel lapin :: Queue >> ` .
&self
ex
&str
queue
&str
opts
QueueOptions
&self
ex
&str
queue
&str
opts
QueueOptions