Struct tower_sessions::SessionRecord
source · pub struct SessionRecord { /* private fields */ }Expand description
A type that represents data to be persisted in a store for a session.
Saving to and loading from a store utilizes SessionRecord.
Implementations§
source§impl SessionRecord
impl SessionRecord
sourcepub fn new(
id: SessionId,
expiration_time: Option<OffsetDateTime>,
data: HashMap<String, Value>
) -> Self
pub fn new( id: SessionId, expiration_time: Option<OffsetDateTime>, data: HashMap<String, Value> ) -> Self
Create a session record.
sourcepub fn expiration_time(&self) -> Option<OffsetDateTime>
pub fn expiration_time(&self) -> Option<OffsetDateTime>
Gets the session expiration time.
Trait Implementations§
source§impl Clone for SessionRecord
impl Clone for SessionRecord
source§fn clone(&self) -> SessionRecord
fn clone(&self) -> SessionRecord
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for SessionRecord
impl Debug for SessionRecord
source§impl<'de> Deserialize<'de> for SessionRecord
impl<'de> Deserialize<'de> for SessionRecord
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
source§impl From<&Session> for SessionRecord
impl From<&Session> for SessionRecord
source§impl From<SessionRecord> for Session
impl From<SessionRecord> for Session
source§fn from(_: SessionRecord) -> Self
fn from(_: SessionRecord) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for SessionRecord
impl Send for SessionRecord
impl Sync for SessionRecord
impl Unpin for SessionRecord
impl UnwindSafe for SessionRecord
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