pub trait EmailService: Send + Sync {
// Required methods
fn send<'life0, 'async_trait>(
&'life0 self,
message: EmailMessage,
) -> Pin<Box<dyn Future<Output = EmailResult<EmailDeliveryReport>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_template<'life0, 'life1, 'async_trait>(
&'life0 self,
template_name: &'life1 str,
recipients: Vec<String>,
template_data: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = EmailResult<Vec<EmailDeliveryReport>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_delivery_status<'life0, 'life1, 'async_trait>(
&'life0 self,
message_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = EmailResult<Option<EmailDeliveryReport>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn cancel_scheduled<'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_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<EmailServiceStats>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn validate_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn test_connection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn send_bulk<'life0, 'async_trait>(
&'life0 self,
messages: Vec<EmailMessage>,
) -> Pin<Box<dyn Future<Output = EmailResult<Vec<EmailDeliveryReport>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Generic email service trait
Required Methods§
Sourcefn send<'life0, 'async_trait>(
&'life0 self,
message: EmailMessage,
) -> Pin<Box<dyn Future<Output = EmailResult<EmailDeliveryReport>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
message: EmailMessage,
) -> Pin<Box<dyn Future<Output = EmailResult<EmailDeliveryReport>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send single email message
Sourcefn send_template<'life0, 'life1, 'async_trait>(
&'life0 self,
template_name: &'life1 str,
recipients: Vec<String>,
template_data: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = EmailResult<Vec<EmailDeliveryReport>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_template<'life0, 'life1, 'async_trait>(
&'life0 self,
template_name: &'life1 str,
recipients: Vec<String>,
template_data: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = EmailResult<Vec<EmailDeliveryReport>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send email using template
Sourcefn get_delivery_status<'life0, 'life1, 'async_trait>(
&'life0 self,
message_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = EmailResult<Option<EmailDeliveryReport>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_delivery_status<'life0, 'life1, 'async_trait>(
&'life0 self,
message_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = EmailResult<Option<EmailDeliveryReport>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get delivery status for a message
Sourcefn cancel_scheduled<'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 cancel_scheduled<'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,
Cancel scheduled email
Sourcefn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<EmailServiceStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<EmailServiceStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get email service statistics
Sourcefn validate_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn validate_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Validate email configuration
Sourcefn test_connection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn test_connection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EmailResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Test email delivery
Provided Methods§
Sourcefn send_bulk<'life0, 'async_trait>(
&'life0 self,
messages: Vec<EmailMessage>,
) -> Pin<Box<dyn Future<Output = EmailResult<Vec<EmailDeliveryReport>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_bulk<'life0, 'async_trait>(
&'life0 self,
messages: Vec<EmailMessage>,
) -> Pin<Box<dyn Future<Output = EmailResult<Vec<EmailDeliveryReport>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send multiple email messages (bulk send)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".