Skip to main content

MqBackend

Trait MqBackend 

Source
pub trait MqBackend: Send + Sync {
    // Required methods
    fn publish_with_headers<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        topic: &'life1 str,
        key: Option<&'life2 str>,
        payload: &'life3 [u8],
        headers: &'life4 HashMap<String, String>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn subscribe<'life0, 'life1, 'async_trait>(
        &'life0 self,
        topic: &'life1 str,
        sender: Sender<Message>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn clean_storage<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_to_dlq<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        topic: &'life1 str,
        id: &'life2 str,
        payload: &'life3 [u8],
        reason: &'life4 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn read_dlq<'life0, 'life1, 'async_trait>(
        &'life0 self,
        topic: &'life1 str,
        count: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Vec<u8>, String, String)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn publish<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        topic: &'life1 str,
        key: Option<&'life2 str>,
        payload: &'life3 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait { ... }
    fn publish_batch<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        topic: &'life1 str,
        items: &'life2 [(Option<String>, Vec<u8>)],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn publish_batch_with_headers<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        topic: &'life1 str,
        items: &'life2 [(Option<String>, Vec<u8>, HashMap<String, String>)],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}

Required Methods§

Source

fn publish_with_headers<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, topic: &'life1 str, key: Option<&'life2 str>, payload: &'life3 [u8], headers: &'life4 HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source

fn subscribe<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 str, sender: Sender<Message>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn send_to_dlq<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, topic: &'life1 str, id: &'life2 str, payload: &'life3 [u8], reason: &'life4 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Send a message to the Dead Letter Queue (DLQ).

Source

fn read_dlq<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 str, count: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Vec<u8>, String, String)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read messages from the Dead Letter Queue (DLQ). Returns a list of (id, payload, reason, original_id).

Provided Methods§

Source

fn publish<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, topic: &'life1 str, key: Option<&'life2 str>, payload: &'life3 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn publish_batch<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 str, items: &'life2 [(Option<String>, Vec<u8>)], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn publish_batch_with_headers<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, topic: &'life1 str, items: &'life2 [(Option<String>, Vec<u8>, HashMap<String, String>)], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§