OutboxStore

Trait OutboxStore 

Source
pub trait OutboxStore {
    // Required methods
    fn add_pending<'life0, 'async_trait>(
        &'life0 self,
        msg: Message,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_pending<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove_pending<'life0, 'life1, 'async_trait>(
        &'life0 self,
        msg_id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn count_pending<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A trait for managing outgoing messages that are pending delivery.

Required Methods§

Source

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

Adds a new message to the outbox.

§Arguments
  • msg - The Message to add.
§Errors

This function will return an error if the message cannot be added.

Source

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

Retrieves all pending messages from the outbox.

Messages are sorted by timestamp for consistent ordering.

§Returns

A Vec of Messages that are pending delivery.

§Errors

This function will return an error if the messages cannot be retrieved.

Source

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

Removes a pending message from the outbox.

§Arguments
  • msg_id - The Uuid of the message to remove.
§Errors

This function will return an error if the message cannot be removed.

Source

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

Returns the number of pending messages in the outbox.

§Errors

This function will return an error if the count cannot be retrieved.

Implementors§