pub trait SqlxSessionModel: AuthSession + SqlxModel {
Show 15 methods
// Required methods
fn id_column() -> &'static str;
fn token_column() -> &'static str;
fn user_id_column() -> &'static str;
fn expires_at_column() -> &'static str;
fn created_at_column() -> &'static str;
fn parse_id(id: &str) -> AuthResult<SqlValue>;
fn parse_user_id(user_id: &str) -> AuthResult<SqlValue>;
fn new_active(
id: Option<SqlValue>,
token: String,
create_session: CreateSession,
now: DateTime<Utc>,
) -> ActiveRow;
fn set_expires_at(active: &mut ActiveRow, expires_at: DateTime<Utc>);
fn set_updated_at(active: &mut ActiveRow, updated_at: DateTime<Utc>);
fn set_active_organization_id(
active: &mut ActiveRow,
organization_id: Option<String>,
);
// Provided methods
fn materialize_secondary(_active: ActiveRow) -> AuthResult<Self> { ... }
fn additional_field_bindings(
fields: &FieldValues,
_backend: Engine,
) -> AuthResult<Vec<(&'static str, SqlValue)>> { ... }
fn set_additional_field(
_active: &mut ActiveRow,
_column: &'static str,
_value: SqlValue,
_backend: Engine,
) -> AuthResult<()> { ... }
fn set_active_team_id(
_active: &mut ActiveRow,
_team_id: Option<String>,
) -> AuthResult<()> { ... }
}Required Methods§
fn id_column() -> &'static str
fn token_column() -> &'static str
fn user_id_column() -> &'static str
fn expires_at_column() -> &'static str
fn created_at_column() -> &'static str
Sourcefn parse_id(id: &str) -> AuthResult<SqlValue>
fn parse_id(id: &str) -> AuthResult<SqlValue>
§Errors
Returns an error if the identifier is invalid for this model’s ID type.
Sourcefn parse_user_id(user_id: &str) -> AuthResult<SqlValue>
fn parse_user_id(user_id: &str) -> AuthResult<SqlValue>
§Errors
Returns an error if the user identifier is invalid for this model’s ID type.
fn new_active( id: Option<SqlValue>, token: String, create_session: CreateSession, now: DateTime<Utc>, ) -> ActiveRow
fn set_expires_at(active: &mut ActiveRow, expires_at: DateTime<Utc>)
fn set_updated_at(active: &mut ActiveRow, updated_at: DateTime<Utc>)
fn set_active_organization_id( active: &mut ActiveRow, organization_id: Option<String>, )
Provided Methods§
Sourcefn materialize_secondary(_active: ActiveRow) -> AuthResult<Self>
fn materialize_secondary(_active: ActiveRow) -> AuthResult<Self>
Materialize the application model without a database insert. Custom schemas opt in to secondary-only sessions by implementing this binding.
§Errors
Returns NotImplemented unless the schema supports secondary sessions.
Sourcefn additional_field_bindings(
fields: &FieldValues,
_backend: Engine,
) -> AuthResult<Vec<(&'static str, SqlValue)>>
fn additional_field_bindings( fields: &FieldValues, _backend: Engine, ) -> AuthResult<Vec<(&'static str, SqlValue)>>
Bind configured fields to actual model columns while retaining raw numbers.
§Errors
Returns an error if configured additional fields cannot be bound to model columns.
Sourcefn set_additional_field(
_active: &mut ActiveRow,
_column: &'static str,
_value: SqlValue,
_backend: Engine,
) -> AuthResult<()>
fn set_additional_field( _active: &mut ActiveRow, _column: &'static str, _value: SqlValue, _backend: Engine, ) -> AuthResult<()>
§Errors
Returns an error if the field value is unsupported by the model column.
Sourcefn set_active_team_id(
_active: &mut ActiveRow,
_team_id: Option<String>,
) -> AuthResult<()>
fn set_active_team_id( _active: &mut ActiveRow, _team_id: Option<String>, ) -> AuthResult<()>
§Errors
Returns an error if the configured model does not support an active-team field.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".