pub struct Payload { /* private fields */ }
Implementations§
Source§impl Payload
impl Payload
pub fn new(json: Value) -> Payload
pub fn get_str(&self, key: &str) -> Option<&str>
pub fn get_i64(&self, key: &str) -> Option<i64>
pub fn get_u64(&self, key: &str) -> Option<u64>
pub fn get_f64(&self, key: &str) -> Option<f64>
pub fn get_bool(&self, key: &str) -> Option<bool>
pub fn get_object(&self, key: &str) -> Option<&Map<String, Value>>
pub fn get_array(&self, key: &str) -> Option<&Vec<Value>>
pub fn get_null(&self, key: &str) -> Option<()>
pub fn into<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
pub fn iss(&self) -> Option<&str>
pub fn sub(&self) -> Option<&str>
pub fn aud(&self) -> Option<&str>
pub fn exp(&self) -> Option<u64>
pub fn nbf(&self) -> Option<u64>
pub fn iat(&self) -> Option<u64>
pub fn jti(&self) -> Option<&str>
pub fn expiry(&self) -> Option<SystemTime>
pub fn issued_at(&self) -> Option<SystemTime>
pub fn not_before(&self) -> Option<SystemTime>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Payload
impl<'de> Deserialize<'de> for Payload
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Payload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Payload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Payload
impl Serialize for Payload
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Payload
impl RefUnwindSafe for Payload
impl Send for Payload
impl Sync for Payload
impl Unpin for Payload
impl UnwindSafe for Payload
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more