Skip to main content

EmailQueue

Trait EmailQueue 

Source
pub trait EmailQueue: Send + Sync {
    // Required methods
    fn enqueue<'life0, 'async_trait>(
        &'life0 self,
        message: EmailMessage,
        scheduled_at: Option<DateTime<Utc>>,
    ) -> Pin<Box<dyn Future<Output = EmailResult<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn dequeue<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = EmailResult<Option<EmailMessage>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn size<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = EmailResult<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn clear<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = EmailResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        message_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = EmailResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_scheduled<'life0, 'async_trait>(
        &'life0 self,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = EmailResult<Vec<EmailMessage>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Email queue management trait

Required Methods§

Source

fn enqueue<'life0, 'async_trait>( &'life0 self, message: EmailMessage, scheduled_at: Option<DateTime<Utc>>, ) -> Pin<Box<dyn Future<Output = EmailResult<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add email to queue

Source

fn dequeue<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = EmailResult<Option<EmailMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get next email from queue

Source

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

Get queue size

Source

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

Clear queue

Source

fn remove<'life0, 'life1, 'async_trait>( &'life0 self, message_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = EmailResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove specific email from queue

Source

fn get_scheduled<'life0, 'async_trait>( &'life0 self, limit: usize, ) -> Pin<Box<dyn Future<Output = EmailResult<Vec<EmailMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get scheduled emails

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§