pub trait SqlxUserModel: AuthUser + SqlxModel {
Show 13 methods
// Required methods
fn id_column() -> &'static str;
fn email_column() -> &'static str;
fn name_column() -> &'static str;
fn created_at_column() -> &'static str;
fn parse_id(id: &str) -> AuthResult<SqlValue>;
fn new_active(
id: Option<SqlValue>,
create_user: CreateUser,
now: DateTime<Utc>,
) -> ActiveRow;
fn apply_update(
active: &mut ActiveRow,
update: UpdateUser,
now: DateTime<Utc>,
);
// Provided methods
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 username_column() -> Option<&'static str> { ... }
fn phone_number_column() -> Option<&'static str> { ... }
fn list_users_column(field: &str) -> Option<&'static str> { ... }
fn prepare_json_metadata(
_active: &mut ActiveRow,
_backend: Engine,
) -> AuthResult<()> { ... }
}Required Methods§
fn id_column() -> &'static str
fn email_column() -> &'static str
fn name_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.
fn new_active( id: Option<SqlValue>, create_user: CreateUser, now: DateTime<Utc>, ) -> ActiveRow
fn apply_update(active: &mut ActiveRow, update: UpdateUser, now: DateTime<Utc>)
Provided Methods§
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 username_column() -> Option<&'static str>
fn username_column() -> Option<&'static str>
Returns the username column, or None if the username plugin is not enabled.
fn phone_number_column() -> Option<&'static str>
Sourcefn list_users_column(field: &str) -> Option<&'static str>
fn list_users_column(field: &str) -> Option<&'static str>
Bind an admin user-list field to its actual model column. Derived models provide all declared fields, including renamed physical columns. Manual models may add their plugin/application field bindings explicitly.
Sourcefn prepare_json_metadata(
_active: &mut ActiveRow,
_backend: Engine,
) -> AuthResult<()>
fn prepare_json_metadata( _active: &mut ActiveRow, _backend: Engine, ) -> AuthResult<()>
Prepare JSON bindings after application hooks and before the atomic write. Manual model implementations may retain their existing binding behavior.
§Errors
Returns an error if metadata preparation fails.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".