Struct metalmq_client::Client[][src]

pub struct Client { /* fields omitted */ }

Represents a connection to AMQP server. It is not a trait since async functions in a trait are not yet supported.

Implementations

impl Client[src]

pub async fn open(&self, virtual_host: &str) -> Result<()>[src]

Client "connects" to a virtual host. The virtual host may or may not exist, in case of an error we got a ClientError and the connection closes.

use metalmq_client::*;

async fn vhost(c: &Client) {
    if let Err(ce) = c.open("/invalid").await {
        eprintln!("Virtual host does not exist");
    }
}

pub async fn close(&self) -> Result<()>[src]

pub async fn channel_open(&self, channel: u16) -> Result<()>[src]

pub async fn channel_close(&self, channel: Channel) -> Result<()>[src]

pub async fn exchange_declare(
    &self,
    channel: Channel,
    exchange_name: &str,
    exchange_type: &str,
    flags: Option<ExchangeDeclareFlags>
) -> Result<()>
[src]

pub async fn queue_bind(
    &self,
    channel: u16,
    queue_name: &str,
    exchange_name: &str,
    routing_key: &str
) -> Result<()>
[src]

pub async fn queue_declare(
    &self,
    channel: Channel,
    queue_name: &str
) -> Result<()>
[src]

pub async fn basic_consume(
    &self,
    channel: Channel,
    queue_name: &str,
    consumer_tag: &str,
    sink: MessageSink
) -> Result<()>
[src]

pub async fn basic_publish(
    &self,
    channel: Channel,
    exchange_name: &str,
    routing_key: &str,
    payload: String
) -> Result<()>
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.