pub trait VerificationCodeSender:
Send
+ Sync
+ 'static {
// Required method
fn send_verification_code<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
code: &'life2 str,
expires_in_seconds: u64,
) -> Pin<Box<dyn Future<Output = Result<(), EmailDeliveryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
通用一次性验证码投递接口(注册之外的场景,如登录 MFA 备用邮箱验证码)。
与 RegistrationEmailSender 语义相同但类型独立:注册场景的邮件文案
(「注册验证码」)不应出现在其他业务场景的投递中。实现方不得记录
recipient 或 code 原文。
Required Methods§
Sourcefn send_verification_code<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
code: &'life2 str,
expires_in_seconds: u64,
) -> Pin<Box<dyn Future<Output = Result<(), EmailDeliveryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn send_verification_code<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
recipient: &'life1 str,
code: &'life2 str,
expires_in_seconds: u64,
) -> Pin<Box<dyn Future<Output = Result<(), EmailDeliveryError>> + 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".