pub struct CtxPayload(/* private fields */);Implementations§
Source§impl CtxPayload
impl CtxPayload
pub fn new(payload: Map<String, Value>) -> Self
pub fn into_inner(self) -> Map<String, Value>
pub fn set_subject(&mut self, value: impl Into<String>)
Sourcepub fn set_expires_at(&mut self, value: impl Into<DateTime<Utc>>)
pub fn set_expires_at(&mut self, value: impl Into<DateTime<Utc>>)
Set the expiration time with DateTime<Utc>.
Sourcepub fn set_exp(&mut self, epoch_seconds: i64)
pub fn set_exp(&mut self, epoch_seconds: i64)
Set the expiration time in seconds since the Unix epoch.
pub fn set_string(&mut self, key: &str, value: impl Into<String>)
pub fn set_i64(&mut self, key: &str, value: i64)
pub fn set_i32(&mut self, key: &str, value: i32)
pub fn set_datetime(&mut self, key: &str, value: impl Into<DateTime<Utc>>)
pub fn set_bool(&mut self, key: &str, value: bool)
pub fn set_strings<I, S>(&mut self, key: &str, value: I)
pub fn get_subject(&self) -> Option<&str>
pub fn get_expires_at(&self) -> Option<DateTime<Utc>>
pub fn get_exp(&self) -> Option<i64>
pub fn get_str(&self, key: &str) -> Option<&str>
pub fn get_i64(&self, key: &str) -> Option<i64>
pub fn get_i32(&self, key: &str) -> Option<i32>
pub fn get_strings(&self, key: &str) -> Option<Vec<&str>>
pub fn get_bool(&self, key: &str) -> Option<bool>
Trait Implementations§
Source§impl Clone for CtxPayload
impl Clone for CtxPayload
Source§impl Debug for CtxPayload
impl Debug for CtxPayload
Source§impl Default for CtxPayload
impl Default for CtxPayload
Source§impl<'de> Deserialize<'de> for CtxPayload
impl<'de> Deserialize<'de> for CtxPayload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CtxPayload
impl RefUnwindSafe for CtxPayload
impl Send for CtxPayload
impl Sync for CtxPayload
impl Unpin for CtxPayload
impl UnsafeUnpin for CtxPayload
impl UnwindSafe for CtxPayload
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