pub struct SmsKitManager { /* private fields */ }Expand description
Enhanced SMS manager powered by SMSKit
Implementations§
Source§impl SmsKitManager
impl SmsKitManager
Sourcepub fn new(storage: Arc<dyn AuthStorage>) -> Self
pub fn new(storage: Arc<dyn AuthStorage>) -> Self
Create a new SMSKit manager with default configuration
Sourcepub fn new_with_config(
storage: Arc<dyn AuthStorage>,
config: SmsKitConfig,
) -> Result<Self>
pub fn new_with_config( storage: Arc<dyn AuthStorage>, config: SmsKitConfig, ) -> Result<Self>
Create a new SMSKit manager with custom configuration
Sourcepub async fn register_phone_number(
&self,
user_id: &str,
phone_number: &str,
) -> Result<()>
pub async fn register_phone_number( &self, user_id: &str, phone_number: &str, ) -> Result<()>
Register phone number for SMS MFA
Sourcepub async fn initiate_challenge(&self, user_id: &str) -> Result<String>
pub async fn initiate_challenge(&self, user_id: &str) -> Result<String>
Initiate SMS challenge with rate limiting
Sourcepub async fn generate_code(&self, challenge_id: &str) -> Result<String>
pub async fn generate_code(&self, challenge_id: &str) -> Result<String>
Generate SMS verification code
Sourcepub async fn verify_code(&self, challenge_id: &str, code: &str) -> Result<bool>
pub async fn verify_code(&self, challenge_id: &str, code: &str) -> Result<bool>
Verify SMS code
Sourcepub async fn send_code(&self, user_id: &str, code: &str) -> Result<()>
pub async fn send_code(&self, user_id: &str, code: &str) -> Result<()>
Send SMS code using SMSKit with fallback support
Sourcepub async fn get_user_phone(&self, user_id: &str) -> Result<Option<String>>
pub async fn get_user_phone(&self, user_id: &str) -> Result<Option<String>>
Get user’s phone number
Sourcepub async fn has_phone_number(&self, user_id: &str) -> Result<bool>
pub async fn has_phone_number(&self, user_id: &str) -> Result<bool>
Check if user has phone number configured
Sourcepub async fn send_verification_code(&self, user_id: &str) -> Result<String>
pub async fn send_verification_code(&self, user_id: &str) -> Result<String>
Send verification code and return the generated code
Auto Trait Implementations§
impl Freeze for SmsKitManager
impl !RefUnwindSafe for SmsKitManager
impl Send for SmsKitManager
impl Sync for SmsKitManager
impl Unpin for SmsKitManager
impl !UnwindSafe for SmsKitManager
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
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