pub struct PushNotificationManager<S: PushChallengeStorage, P: PushNotificationProvider> { /* private fields */ }Expand description
Push notification manager
Implementations§
Source§impl<S: PushChallengeStorage, P: PushNotificationProvider> PushNotificationManager<S, P>
impl<S: PushChallengeStorage, P: PushNotificationProvider> PushNotificationManager<S, P>
Sourcepub fn new(
storage: S,
provider: P,
config: PushNotificationConfig,
encryption_key: Option<&[u8; 32]>,
) -> Self
pub fn new( storage: S, provider: P, config: PushNotificationConfig, encryption_key: Option<&[u8; 32]>, ) -> Self
Create a new manager
Sourcepub async fn create_challenge(
&self,
user_id: UserId,
tenant_id: TenantId,
context: PushContext,
) -> Result<PushChallenge, PushError>
pub async fn create_challenge( &self, user_id: UserId, tenant_id: TenantId, context: PushContext, ) -> Result<PushChallenge, PushError>
Create push challenge
Sourcepub async fn send_push_notification(
&self,
challenge: &PushChallenge,
platform: DevicePlatform,
) -> Result<String, PushError>
pub async fn send_push_notification( &self, challenge: &PushChallenge, platform: DevicePlatform, ) -> Result<String, PushError>
Send push notification
Sourcepub async fn verify_number_match(
&self,
challenge_id: &str,
provided_code: &str,
) -> Result<bool, PushError>
pub async fn verify_number_match( &self, challenge_id: &str, provided_code: &str, ) -> Result<bool, PushError>
Verify number match
Sourcepub async fn respond_to_challenge(
&self,
challenge_id: &str,
response: PushResponse,
) -> Result<(), PushError>
pub async fn respond_to_challenge( &self, challenge_id: &str, response: PushResponse, ) -> Result<(), PushError>
Respond to challenge (approve/deny)
Sourcepub fn encrypt_payload(
&self,
challenge: &PushChallenge,
) -> Result<EncryptedPushPayload, PushError>
pub fn encrypt_payload( &self, challenge: &PushChallenge, ) -> Result<EncryptedPushPayload, PushError>
Encrypt push payload (if encryption enabled)
Auto Trait Implementations§
impl<S, P> Freeze for PushNotificationManager<S, P>
impl<S, P> RefUnwindSafe for PushNotificationManager<S, P>where
S: RefUnwindSafe,
P: RefUnwindSafe,
impl<S, P> Send for PushNotificationManager<S, P>
impl<S, P> Sync for PushNotificationManager<S, P>
impl<S, P> Unpin for PushNotificationManager<S, P>
impl<S, P> UnsafeUnpin for PushNotificationManager<S, P>where
S: UnsafeUnpin,
P: UnsafeUnpin,
impl<S, P> UnwindSafe for PushNotificationManager<S, P>where
S: UnwindSafe,
P: UnwindSafe,
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