pub struct EmailOtpCallbacks<S: AuthSchema> { /* private fields */ }Expand description
Email OTP callbacks with the complete endpoint context.
Implementations§
Source§impl<S: AuthSchema> EmailOtpCallbacks<S>
impl<S: AuthSchema> EmailOtpCallbacks<S>
Sourcepub fn send<F>(self, callback: F) -> Selfwhere
F: Fn(&EmailOtpMessage, &EndpointContext<'_, S>) -> AuthResult<Option<BackgroundFuture>> + Send + Sync + 'static,
pub fn send<F>(self, callback: F) -> Selfwhere
F: Fn(&EmailOtpMessage, &EndpointContext<'_, S>) -> AuthResult<Option<BackgroundFuture>> + Send + Sync + 'static,
Construct delivery work after persisting the OTP. Factory errors propagate immediately.
Retain the endpoint with to_owned when delivery uses its runtime or transaction.
Sourcepub fn generate<F>(self, callback: F) -> Selfwhere
F: Fn(&str, EmailOtpType, &EndpointContext<'_, S>) -> AuthResult<Option<String>> + Send + Sync + 'static,
pub fn generate<F>(self, callback: F) -> Selfwhere
F: Fn(&str, EmailOtpType, &EndpointContext<'_, S>) -> AuthResult<Option<String>> + Send + Sync + 'static,
Generate OTPs synchronously; None or an empty code selects decimal generation.
Trait Implementations§
Source§impl<S: AuthSchema> Default for EmailOtpCallbacks<S>
impl<S: AuthSchema> Default for EmailOtpCallbacks<S>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for EmailOtpCallbacks<S>
impl<S> !UnwindSafe for EmailOtpCallbacks<S>
impl<S> Freeze for EmailOtpCallbacks<S>where
Option<Arc<dyn Fn(&EmailOtpMessage, &EndpointContext<'_, S>) -> Result<Option<Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>>>, AuthError> + Send + Sync>>: Freeze,
Option<Arc<dyn Fn(&str, EmailOtpType, &EndpointContext<'_, S>) -> Result<Option<String>, AuthError> + Send + Sync>>: Freeze,
impl<S> Send for EmailOtpCallbacks<S>where
Option<Arc<dyn Fn(&EmailOtpMessage, &EndpointContext<'_, S>) -> Result<Option<Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>>>, AuthError> + Send + Sync>>: Send,
Option<Arc<dyn Fn(&str, EmailOtpType, &EndpointContext<'_, S>) -> Result<Option<String>, AuthError> + Send + Sync>>: Send,
impl<S> Sync for EmailOtpCallbacks<S>where
Option<Arc<dyn Fn(&EmailOtpMessage, &EndpointContext<'_, S>) -> Result<Option<Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>>>, AuthError> + Send + Sync>>: Sync,
Option<Arc<dyn Fn(&str, EmailOtpType, &EndpointContext<'_, S>) -> Result<Option<String>, AuthError> + Send + Sync>>: Sync,
impl<S> Unpin for EmailOtpCallbacks<S>where
Option<Arc<dyn Fn(&EmailOtpMessage, &EndpointContext<'_, S>) -> Result<Option<Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>>>, AuthError> + Send + Sync>>: Unpin,
Option<Arc<dyn Fn(&str, EmailOtpType, &EndpointContext<'_, S>) -> Result<Option<String>, AuthError> + Send + Sync>>: Unpin,
impl<S> UnsafeUnpin for EmailOtpCallbacks<S>where
Option<Arc<dyn Fn(&EmailOtpMessage, &EndpointContext<'_, S>) -> Result<Option<Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>>>, AuthError> + Send + Sync>>: UnsafeUnpin,
Option<Arc<dyn Fn(&str, EmailOtpType, &EndpointContext<'_, S>) -> Result<Option<String>, AuthError> + Send + Sync>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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