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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<usize>> + 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,
Get queue size
Sourcefn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<()>> + 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,
Clear queue
Sourcefn 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 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
Sourcefn 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,
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".