pub struct PhoneNumberCallbacks<S: AuthSchema> { /* private fields */ }Expand description
Phone callbacks with parsed endpoint input and the complete authentication runtime.
Implementations§
Source§impl<S: AuthSchema> PhoneNumberCallbacks<S>
impl<S: AuthSchema> PhoneNumberCallbacks<S>
Sourcepub fn send_otp<F>(self, callback: F) -> Selfwhere
F: Fn(&PhoneOtp, &EndpointContext<'_, S>) -> AuthResult<Option<BackgroundFuture>> + Send + Sync + 'static,
pub fn send_otp<F>(self, callback: F) -> Selfwhere
F: Fn(&PhoneOtp, &EndpointContext<'_, S>) -> AuthResult<Option<BackgroundFuture>> + Send + Sync + 'static,
Start verification delivery. Return None for synchronous completion.
Retain the endpoint with to_owned when asynchronous delivery needs its context.
Sourcepub fn send_password_reset_otp<F>(self, callback: F) -> Selfwhere
F: Fn(&PhoneOtp, &EndpointContext<'_, S>) -> AuthResult<Option<BackgroundFuture>> + Send + Sync + 'static,
pub fn send_password_reset_otp<F>(self, callback: F) -> Selfwhere
F: Fn(&PhoneOtp, &EndpointContext<'_, S>) -> AuthResult<Option<BackgroundFuture>> + Send + Sync + 'static,
Start password reset delivery. Return None for synchronous completion.
Sourcepub fn verify_otp<F>(self, callback: F) -> Selfwhere
F: for<'a> Fn(&'a PhoneOtp, &'a EndpointContext<'_, S>) -> PhoneCallbackFuture<'a, bool> + Send + Sync + 'static,
pub fn verify_otp<F>(self, callback: F) -> Selfwhere
F: for<'a> Fn(&'a PhoneOtp, &'a EndpointContext<'_, S>) -> PhoneCallbackFuture<'a, bool> + Send + Sync + 'static,
Verify a code using an external provider.
Sourcepub fn on_verification<F>(self, callback: F) -> Selfwhere
F: for<'a> Fn(&'a PhoneVerification, &'a EndpointContext<'_, S>) -> PhoneCallbackFuture<'a, ()> + Send + Sync + 'static,
pub fn on_verification<F>(self, callback: F) -> Selfwhere
F: for<'a> Fn(&'a PhoneVerification, &'a EndpointContext<'_, S>) -> PhoneCallbackFuture<'a, ()> + Send + Sync + 'static,
Observe the persisted user before a session is created.
Trait Implementations§
Source§impl<S: AuthSchema> Default for PhoneNumberCallbacks<S>
impl<S: AuthSchema> Default for PhoneNumberCallbacks<S>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for PhoneNumberCallbacks<S>
impl<S> !UnwindSafe for PhoneNumberCallbacks<S>
impl<S> Freeze for PhoneNumberCallbacks<S>where
Option<Arc<dyn Fn(&PhoneOtp, &EndpointContext<'_, S>) -> Result<Option<Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>>>, AuthError> + Send + Sync>>: Freeze,
Option<Arc<dyn for<'a> Fn(&'a PhoneOtp, &'a EndpointContext<'_, S>) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'a>> + Send + Sync>>: Freeze,
Option<Arc<dyn for<'a> Fn(&'a PhoneVerification, &'a EndpointContext<'_, S>) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'a>> + Send + Sync>>: Freeze,
impl<S> Send for PhoneNumberCallbacks<S>where
Option<Arc<dyn Fn(&PhoneOtp, &EndpointContext<'_, S>) -> Result<Option<Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>>>, AuthError> + Send + Sync>>: Send,
Option<Arc<dyn for<'a> Fn(&'a PhoneOtp, &'a EndpointContext<'_, S>) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'a>> + Send + Sync>>: Send,
Option<Arc<dyn for<'a> Fn(&'a PhoneVerification, &'a EndpointContext<'_, S>) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'a>> + Send + Sync>>: Send,
impl<S> Sync for PhoneNumberCallbacks<S>where
Option<Arc<dyn Fn(&PhoneOtp, &EndpointContext<'_, S>) -> Result<Option<Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>>>, AuthError> + Send + Sync>>: Sync,
Option<Arc<dyn for<'a> Fn(&'a PhoneOtp, &'a EndpointContext<'_, S>) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'a>> + Send + Sync>>: Sync,
Option<Arc<dyn for<'a> Fn(&'a PhoneVerification, &'a EndpointContext<'_, S>) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'a>> + Send + Sync>>: Sync,
impl<S> Unpin for PhoneNumberCallbacks<S>where
Option<Arc<dyn Fn(&PhoneOtp, &EndpointContext<'_, S>) -> Result<Option<Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>>>, AuthError> + Send + Sync>>: Unpin,
Option<Arc<dyn for<'a> Fn(&'a PhoneOtp, &'a EndpointContext<'_, S>) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'a>> + Send + Sync>>: Unpin,
Option<Arc<dyn for<'a> Fn(&'a PhoneVerification, &'a EndpointContext<'_, S>) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'a>> + Send + Sync>>: Unpin,
impl<S> UnsafeUnpin for PhoneNumberCallbacks<S>where
Option<Arc<dyn Fn(&PhoneOtp, &EndpointContext<'_, S>) -> Result<Option<Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send>>>, AuthError> + Send + Sync>>: UnsafeUnpin,
Option<Arc<dyn for<'a> Fn(&'a PhoneOtp, &'a EndpointContext<'_, S>) -> Pin<Box<dyn Future<Output = Result<bool, AuthError>> + Send + 'a>> + Send + Sync>>: UnsafeUnpin,
Option<Arc<dyn for<'a> Fn(&'a PhoneVerification, &'a EndpointContext<'_, S>) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'a>> + 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