pub struct JsJwtBuilder { /* private fields */ }
Expand description
Builder object for creating and signing a JWT (JSON Web Token) with or without an associated content.
@see JwtParser
Implementations§
Source§impl JsJwtBuilder
impl JsJwtBuilder
Sourcepub fn new() -> JsJwtBuilder
pub fn new() -> JsJwtBuilder
Creates a new JWT without an associated content. The time of creation is set in this call.
Sourcepub fn with_content_id(content_id: &str) -> JsJwtBuilder
pub fn with_content_id(content_id: &str) -> JsJwtBuilder
Creates a new JWT without an associated content. The time of creation is set in this call.
Sourcepub fn get_time_to_live(&self) -> i64
pub fn get_time_to_live(&self) -> i64
Gets how long the token is valid. (5 seconds by default)
Sourcepub fn set_time_to_live(&mut self, seconds: i64)
pub fn set_time_to_live(&mut self, seconds: i64)
Sets how long the token is valid.
Trait Implementations§
Source§impl Default for JsJwtBuilder
impl Default for JsJwtBuilder
Source§fn default() -> JsJwtBuilder
fn default() -> JsJwtBuilder
Returns the “default value” for a type. Read more
Source§impl From<JsJwtBuilder> for JsValue
impl From<JsJwtBuilder> for JsValue
Source§fn from(value: JsJwtBuilder) -> JsValue
fn from(value: JsJwtBuilder) -> JsValue
Converts to this type from the input type.
Source§impl FromWasmAbi for JsJwtBuilder
impl FromWasmAbi for JsJwtBuilder
Source§impl IntoWasmAbi for JsJwtBuilder
impl IntoWasmAbi for JsJwtBuilder
Source§impl LongRefFromWasmAbi for JsJwtBuilder
impl LongRefFromWasmAbi for JsJwtBuilder
Source§type Anchor = RcRef<JsJwtBuilder>
type Anchor = RcRef<JsJwtBuilder>
Same as
RefFromWasmAbi::Anchor
Source§unsafe fn long_ref_from_abi(
js: <JsJwtBuilder as LongRefFromWasmAbi>::Abi,
) -> <JsJwtBuilder as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <JsJwtBuilder as LongRefFromWasmAbi>::Abi, ) -> <JsJwtBuilder as LongRefFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
Source§impl OptionFromWasmAbi for JsJwtBuilder
impl OptionFromWasmAbi for JsJwtBuilder
Source§fn is_none(abi: &<JsJwtBuilder as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<JsJwtBuilder 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 JsJwtBuilder
impl OptionIntoWasmAbi for JsJwtBuilder
Source§fn none() -> <JsJwtBuilder as IntoWasmAbi>::Abi
fn none() -> <JsJwtBuilder 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 JsJwtBuilder
impl RefFromWasmAbi for JsJwtBuilder
Source§type Anchor = RcRef<JsJwtBuilder>
type Anchor = RcRef<JsJwtBuilder>
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: <JsJwtBuilder as RefFromWasmAbi>::Abi,
) -> <JsJwtBuilder as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <JsJwtBuilder as RefFromWasmAbi>::Abi, ) -> <JsJwtBuilder as RefFromWasmAbi>::Anchor
Source§impl RefMutFromWasmAbi for JsJwtBuilder
impl RefMutFromWasmAbi for JsJwtBuilder
Source§type Anchor = RcRefMut<JsJwtBuilder>
type Anchor = RcRefMut<JsJwtBuilder>
Same as
RefFromWasmAbi::Anchor
Source§unsafe fn ref_mut_from_abi(
js: <JsJwtBuilder as RefMutFromWasmAbi>::Abi,
) -> <JsJwtBuilder as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <JsJwtBuilder as RefMutFromWasmAbi>::Abi, ) -> <JsJwtBuilder as RefMutFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
Source§impl TryFromJsValue for JsJwtBuilder
impl TryFromJsValue for JsJwtBuilder
Source§fn try_from_js_value(
value: JsValue,
) -> Result<JsJwtBuilder, <JsJwtBuilder as TryFromJsValue>::Error>
fn try_from_js_value( value: JsValue, ) -> Result<JsJwtBuilder, <JsJwtBuilder as TryFromJsValue>::Error>
Performs the conversion.
Source§impl VectorFromWasmAbi for JsJwtBuilder
impl VectorFromWasmAbi for JsJwtBuilder
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <JsJwtBuilder as VectorFromWasmAbi>::Abi, ) -> Box<[JsJwtBuilder]>
Source§impl VectorIntoWasmAbi for JsJwtBuilder
impl VectorIntoWasmAbi for JsJwtBuilder
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[JsJwtBuilder]>, ) -> <JsJwtBuilder as VectorIntoWasmAbi>::Abi
Auto Trait Implementations§
impl Freeze for JsJwtBuilder
impl RefUnwindSafe for JsJwtBuilder
impl Send for JsJwtBuilder
impl Sync for JsJwtBuilder
impl Unpin for JsJwtBuilder
impl UnwindSafe for JsJwtBuilder
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
.