pub struct AMQPConnection { /* private fields */ }Expand description
A instance of a connection to an AMQP queue.
§Example
use paladin::queue::{
amqp::{AMQPConnection, AMQPConnectionOptions}
};
let conn = AMQPConnection::new(AMQPConnectionOptions {
uri: "amqp://localhost:5672",
qos: Some(1),
serializer: Default::default(),
}).await?;
Ok(())Implementations§
Source§impl AMQPConnection
impl AMQPConnection
Sourcepub async fn new(__arg0: AMQPConnectionOptions<'_>) -> Result<Self>
pub async fn new(__arg0: AMQPConnectionOptions<'_>) -> Result<Self>
Get a handle to the connection.
Trait Implementations§
Source§impl Clone for AMQPConnection
impl Clone for AMQPConnection
Source§fn clone(&self) -> AMQPConnection
fn clone(&self) -> AMQPConnection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Connection for AMQPConnection
impl Connection for AMQPConnection
Source§fn declare_queue<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
options: QueueOptions,
) -> Pin<Box<dyn Future<Output = Result<Self::QueueHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn declare_queue<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
options: QueueOptions,
) -> Pin<Box<dyn Future<Output = Result<Self::QueueHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Declare an AMQP queue with the given name.
queue::{Connection, QueueOptions, amqp::{AMQPConnection, AMQPConnectionOptions}}
};
let conn = AMQPConnection::new(AMQPConnectionOptions {
uri: "amqp://localhost:5672",
qos: Some(1),
serializer: Default::default(),
}).await?;
let queue = conn.declare_queue("my_queue", QueueOptions::default()).await?;
Ok(())type QueueHandle = AMQPQueueHandle
Auto Trait Implementations§
impl Freeze for AMQPConnection
impl !RefUnwindSafe for AMQPConnection
impl Send for AMQPConnection
impl Sync for AMQPConnection
impl Unpin for AMQPConnection
impl !UnwindSafe for AMQPConnection
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more