pub struct Parser { /* private fields */ }
Implementations§
Source§impl Parser
impl Parser
pub const GOOGLE_CERT_URL: &'static str = "https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com"
pub fn new(client_id: &str) -> Self
pub fn new_with_custom_cert_url(client_id: &str, public_key_url: &str) -> Self
Sourcepub async fn parse<T: Serialize + DeserializeOwned>(
&mut self,
token: &str,
now: SystemTime,
) -> Result<JWTClaims<T>, ParserError>
pub async fn parse<T: Serialize + DeserializeOwned>( &mut self, token: &str, now: SystemTime, ) -> Result<JWTClaims<T>, ParserError>
Parses and validates the provided token. Validation is done against the associated DecodingKey for the kid of the token, fetched from the key_provider (google).
Auto Trait Implementations§
impl Freeze for Parser
impl !RefUnwindSafe for Parser
impl Send for Parser
impl !Sync for Parser
impl Unpin for Parser
impl !UnwindSafe for Parser
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