pub struct JsJwtParser { /* private fields */ }
Expand description
Parser for reading a JWT (JSON Web Token) from a string and validate its content and signature.
Implementations§
Source§impl JsJwtParser
impl JsJwtParser
Sourcepub fn new(token: &str) -> Result<JsJwtParser, JsValue>
pub fn new(token: &str) -> Result<JsJwtParser, JsValue>
Parse JWT from a string created with {@link JwtBuilder}
Sourcepub fn public_key(&self) -> JsMPublicKey
pub fn public_key(&self) -> JsMPublicKey
Returns the public key that signed the token
Sourcepub fn created_at(&self) -> i64
pub fn created_at(&self) -> i64
Returns the UTC date-time instance the token was created
Sourcepub fn time_to_live(&self) -> i64
pub fn time_to_live(&self) -> i64
Returns how long the token stays valid
Trait Implementations§
Source§impl From<JsJwtParser> for JsValue
impl From<JsJwtParser> for JsValue
Source§fn from(value: JsJwtParser) -> JsValue
fn from(value: JsJwtParser) -> JsValue
Converts to this type from the input type.
Source§impl FromWasmAbi for JsJwtParser
impl FromWasmAbi for JsJwtParser
Source§impl IntoWasmAbi for JsJwtParser
impl IntoWasmAbi for JsJwtParser
Source§impl LongRefFromWasmAbi for JsJwtParser
impl LongRefFromWasmAbi for JsJwtParser
Source§type Anchor = RcRef<JsJwtParser>
type Anchor = RcRef<JsJwtParser>
Same as
RefFromWasmAbi::Anchor
Source§unsafe fn long_ref_from_abi(
js: <JsJwtParser as LongRefFromWasmAbi>::Abi,
) -> <JsJwtParser as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <JsJwtParser as LongRefFromWasmAbi>::Abi, ) -> <JsJwtParser as LongRefFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
Source§impl OptionFromWasmAbi for JsJwtParser
impl OptionFromWasmAbi for JsJwtParser
Source§fn is_none(abi: &<JsJwtParser as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<JsJwtParser as FromWasmAbi>::Abi) -> bool
Tests whether the argument is a “none” instance. If so it will be
deserialized as
None
, and otherwise it will be passed to
FromWasmAbi
.Source§impl OptionIntoWasmAbi for JsJwtParser
impl OptionIntoWasmAbi for JsJwtParser
Source§fn none() -> <JsJwtParser as IntoWasmAbi>::Abi
fn none() -> <JsJwtParser as IntoWasmAbi>::Abi
Returns an ABI instance indicating “none”, which JS will interpret as
the
None
branch of this option. Read moreSource§impl RefFromWasmAbi for JsJwtParser
impl RefFromWasmAbi for JsJwtParser
Source§type Anchor = RcRef<JsJwtParser>
type Anchor = RcRef<JsJwtParser>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§unsafe fn ref_from_abi(
js: <JsJwtParser as RefFromWasmAbi>::Abi,
) -> <JsJwtParser as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <JsJwtParser as RefFromWasmAbi>::Abi, ) -> <JsJwtParser as RefFromWasmAbi>::Anchor
Source§impl RefMutFromWasmAbi for JsJwtParser
impl RefMutFromWasmAbi for JsJwtParser
Source§type Anchor = RcRefMut<JsJwtParser>
type Anchor = RcRefMut<JsJwtParser>
Same as
RefFromWasmAbi::Anchor
Source§unsafe fn ref_mut_from_abi(
js: <JsJwtParser as RefMutFromWasmAbi>::Abi,
) -> <JsJwtParser as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <JsJwtParser as RefMutFromWasmAbi>::Abi, ) -> <JsJwtParser as RefMutFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
Source§impl TryFromJsValue for JsJwtParser
impl TryFromJsValue for JsJwtParser
Source§fn try_from_js_value(
value: JsValue,
) -> Result<JsJwtParser, <JsJwtParser as TryFromJsValue>::Error>
fn try_from_js_value( value: JsValue, ) -> Result<JsJwtParser, <JsJwtParser as TryFromJsValue>::Error>
Performs the conversion.
Source§impl VectorFromWasmAbi for JsJwtParser
impl VectorFromWasmAbi for JsJwtParser
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <JsJwtParser as VectorFromWasmAbi>::Abi, ) -> Box<[JsJwtParser]>
Source§impl VectorIntoWasmAbi for JsJwtParser
impl VectorIntoWasmAbi for JsJwtParser
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[JsJwtParser]>, ) -> <JsJwtParser as VectorIntoWasmAbi>::Abi
Auto Trait Implementations§
impl Freeze for JsJwtParser
impl RefUnwindSafe for JsJwtParser
impl Send for JsJwtParser
impl Sync for JsJwtParser
impl Unpin for JsJwtParser
impl UnwindSafe for JsJwtParser
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
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.