Trait Connection

Source
pub trait Connection: Clone {
    type QueueHandle: QueueHandle;

    // Required methods
    fn close<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: '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;
    fn delete_queue<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A connection to a queue.

Connections should be cheap to clone such that references need not be passed around.

Required Associated Types§

Required Methods§

Source

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close the connection.

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,

Declare a queue.

Queue declaration should be idempotent, in that it should instantiate a queue if it does not exist, and otherwise return the existing queue.

Source

fn delete_queue<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete the queue.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§