pub struct VerificationCodeSenderHandle(/* private fields */);Expand description
可放入 Tools 扩展槽的类型擦除投递句柄(VerificationCodeSender)。
Implementations§
Source§impl VerificationCodeSenderHandle
impl VerificationCodeSenderHandle
Sourcepub fn new<T>(sender: T) -> Selfwhere
T: VerificationCodeSender,
pub fn new<T>(sender: T) -> Selfwhere
T: VerificationCodeSender,
用业务投递器创建句柄。
Sourcepub fn from_arc(sender: Arc<dyn VerificationCodeSender>) -> Self
pub fn from_arc(sender: Arc<dyn VerificationCodeSender>) -> Self
从已共享的投递器创建句柄。
Sourcepub async fn send_verification_code(
&self,
recipient: &str,
code: &str,
expires_in_seconds: u64,
) -> Result<(), EmailDeliveryError>
pub async fn send_verification_code( &self, recipient: &str, code: &str, expires_in_seconds: u64, ) -> Result<(), EmailDeliveryError>
投递一枚短期验证码。
Trait Implementations§
Source§impl Clone for VerificationCodeSenderHandle
impl Clone for VerificationCodeSenderHandle
Auto Trait Implementations§
impl !RefUnwindSafe for VerificationCodeSenderHandle
impl !UnwindSafe for VerificationCodeSenderHandle
impl Forget for VerificationCodeSenderHandle
impl Freeze for VerificationCodeSenderHandle
impl Move for VerificationCodeSenderHandle
impl Send for VerificationCodeSenderHandle
impl Sync for VerificationCodeSenderHandle
impl Unpin for VerificationCodeSenderHandle
impl UnsafeUnpin for VerificationCodeSenderHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more