Struct metalmq_client::Client [−][src]
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]
&self,
channel: Channel,
exchange_name: &str,
exchange_type: &str,
flags: Option<ExchangeDeclareFlags>
) -> Result<()>
pub async fn queue_bind(
&self,
channel: u16,
queue_name: &str,
exchange_name: &str,
routing_key: &str
) -> Result<()>
[src]
&self,
channel: u16,
queue_name: &str,
exchange_name: &str,
routing_key: &str
) -> Result<()>
pub async fn queue_declare(
&self,
channel: Channel,
queue_name: &str
) -> Result<()>
[src]
&self,
channel: Channel,
queue_name: &str
) -> Result<()>
pub async fn basic_consume(
&self,
channel: Channel,
queue_name: &str,
consumer_tag: &str,
sink: MessageSink
) -> Result<()>
[src]
&self,
channel: Channel,
queue_name: &str,
consumer_tag: &str,
sink: MessageSink
) -> Result<()>
pub async fn basic_publish(
&self,
channel: Channel,
exchange_name: &str,
routing_key: &str,
payload: String
) -> Result<()>
[src]
&self,
channel: Channel,
exchange_name: &str,
routing_key: &str,
payload: String
) -> Result<()>
Auto Trait Implementations
impl !RefUnwindSafe for Client
[src]
impl Send for Client
[src]
impl Sync for Client
[src]
impl Unpin for Client
[src]
impl !UnwindSafe for Client
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,