pub struct AsyncClient { /* private fields */ }
Expand description
AsyncClient is an async client to do verification.
Implementations§
Source§impl AsyncClient
impl AsyncClient
Sourcepub fn new_with_vec<T, V>(client_ids: T) -> Self
pub fn new_with_vec<T, V>(client_ids: T) -> Self
Create a new async client, with multiple client ids.
Sourcepub async fn add_client_id<T: ToString>(&mut self, client_id: T)
pub async fn add_client_id<T: ToString>(&mut self, client_id: T)
Add a new client_id for future validating.
Note: this function is thread safe.
Sourcepub async fn remove_client_id<T: AsRef<str>>(&mut self, client_id: T)
pub async fn remove_client_id<T: AsRef<str>>(&mut self, client_id: T)
Remove a client_id, if it exists.
Note: this function is thread safe.
Sourcepub fn timeout(self, d: Duration) -> Self
pub fn timeout(self, d: Duration) -> Self
Set the timeout (used in fetching google certs). Default timeout is 5 seconds. Zero timeout will be ignored.
Sourcepub async fn validate_id_token<S>(&self, token: S) -> Result<GooglePayload>
pub async fn validate_id_token<S>(&self, token: S) -> Result<GooglePayload>
Do verification with id_token
. If succeed, return the user data.
Sourcepub async fn validate_access_token<S>(
&self,
token: S,
) -> Result<GoogleAccessTokenPayload>
pub async fn validate_access_token<S>( &self, token: S, ) -> Result<GoogleAccessTokenPayload>
Try to validate access token. If succeed, return the user info.
Trait Implementations§
Source§impl Clone for AsyncClient
impl Clone for AsyncClient
Source§fn clone(&self) -> AsyncClient
fn clone(&self) -> AsyncClient
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AsyncClient
impl Debug for AsyncClient
Auto Trait Implementations§
impl Freeze for AsyncClient
impl !RefUnwindSafe for AsyncClient
impl Send for AsyncClient
impl Sync for AsyncClient
impl Unpin for AsyncClient
impl !UnwindSafe for AsyncClient
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