pub struct Session {
pub id: Id,
pub token_hash: Hash,
pub user_id: Id,
pub expires_at: OffsetDateTime,
pub ip_address: Option<String>,
pub user_agent: Option<String>,
pub created_at: OffsetDateTime,
pub updated_at: OffsetDateTime,
}Expand description
A row of session. By default the token itself is never stored, only its SHA-256;
with SessionTokens::Raw the table holds the token in token instead, and
token_hash is computed from it when the row is read.
Fields§
§id: Id§token_hash: Hash§user_id: Id§expires_at: OffsetDateTime§ip_address: Option<String>§user_agent: Option<String>§created_at: OffsetDateTime§updated_at: OffsetDateTimeImplementations§
Source§impl Session
impl Session
pub const ID: Col<Session, Id>
pub const TOKEN_HASH: Col<Session, Hash>
Sourcepub const TOKEN: Col<Session, String>
pub const TOKEN: Col<Session, String>
The token itself, only with SessionTokens::Raw. Never sent to clients. Filter by
a token with CoreConfig::session_token_eq,
which works under either setting.
pub const USER_ID: Col<Session, Id>
pub const EXPIRES_AT: Col<Session, OffsetDateTime>
pub const CREATED_AT: Col<Session, OffsetDateTime>
pub const UPDATED_AT: Col<Session, OffsetDateTime>
Trait Implementations§
impl StructuralPartialEq for Session
Auto Trait Implementations§
impl Forget for Session
impl Freeze for Session
impl Move for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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