pub struct Session {
pub id: String,
pub token_hash: String,
pub user_id: String,
pub ip_address: String,
pub user_agent: String,
pub device_name: String,
pub device_type: String,
pub fingerprint: String,
pub data: String,
pub created_at: DateTime<Utc>,
pub last_active_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
}Fields§
§id: String§token_hash: String§user_id: String§ip_address: String§user_agent: String§device_name: String§device_type: String§fingerprint: String§data: String§created_at: DateTime<Utc>§last_active_at: DateTime<Utc>§expires_at: DateTime<Utc>Implementations§
Source§impl Session
impl Session
pub async fn find_by_id( id: &str, db: &impl ConnectionTrait, ) -> Result<Self, Error>
Sourcepub async fn delete_by_id(
id: &str,
db: &impl ConnectionTrait,
) -> Result<(), Error>
pub async fn delete_by_id( id: &str, db: &impl ConnectionTrait, ) -> Result<(), Error>
Delete a record by ID. Loads the record first to invoke before_delete.
pub async fn insert(self, db: &impl ConnectionTrait) -> Result<Self, Error>
pub async fn update(&mut self, db: &impl ConnectionTrait) -> Result<(), Error>
pub async fn delete(self, db: &impl ConnectionTrait) -> Result<(), Error>
Trait Implementations§
Source§impl Record for Session
impl Record for Session
type Entity = Entity
type ActiveModel = ActiveModel
Source§fn from_model(model: <Entity as EntityTrait>::Model) -> Self
fn from_model(model: <Entity as EntityTrait>::Model) -> Self
Convert a SeaORM model to the domain type.
Source§fn into_active_model_full(&self) -> ActiveModel
fn into_active_model_full(&self) -> ActiveModel
Convert to an active model with ALL fields set.
Source§fn into_active_model(&self) -> ActiveModel
fn into_active_model(&self) -> ActiveModel
Convert to an active model with only PK fields set (rest NotSet).
Source§fn apply_auto_fields(am: &mut ActiveModel, is_insert: bool)
fn apply_auto_fields(am: &mut ActiveModel, is_insert: bool)
Fill auto-generated fields (ID, timestamps) on an active model.
Source§fn find_all(
db: &impl ConnectionTrait,
) -> impl Future<Output = Result<Vec<Self>, Error>> + Sendwhere
<Self::Entity as EntityTrait>::Model: FromQueryResult + Send + Sync,
Self: From<<Self::Entity as EntityTrait>::Model>,
fn find_all(
db: &impl ConnectionTrait,
) -> impl Future<Output = Result<Vec<Self>, Error>> + Sendwhere
<Self::Entity as EntityTrait>::Model: FromQueryResult + Send + Sync,
Self: From<<Self::Entity as EntityTrait>::Model>,
Fetch all records.
Source§fn query() -> EntityQuery<Self, Self::Entity>where
<Self::Entity as EntityTrait>::Model: FromQueryResult + Send + Sync,
Self: From<<Self::Entity as EntityTrait>::Model>,
fn query() -> EntityQuery<Self, Self::Entity>where
<Self::Entity as EntityTrait>::Model: FromQueryResult + Send + Sync,
Self: From<<Self::Entity as EntityTrait>::Model>,
Start a chainable query builder.
Source§fn update_many() -> EntityUpdateMany<Self::Entity>
fn update_many() -> EntityUpdateMany<Self::Entity>
Start a bulk UPDATE builder.
Source§fn delete_many() -> EntityDeleteMany<Self::Entity>
fn delete_many() -> EntityDeleteMany<Self::Entity>
Start a bulk DELETE builder.
Auto Trait Implementations§
impl Freeze 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DefaultHooks for T
impl<T> DefaultHooks for T
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