pub struct Model {Show 18 fields
pub id: String,
pub name: String,
pub email: String,
pub email_verified: bool,
pub image: Option<String>,
pub username: Option<String>,
pub display_username: Option<String>,
pub two_factor_enabled: Option<bool>,
pub role: Option<String>,
pub banned: Option<bool>,
pub ban_reason: Option<String>,
pub ban_expires: Option<DateTime<Utc>>,
pub is_anonymous: Option<bool>,
pub phone_number: Option<String>,
pub phone_number_verified: Option<bool>,
pub last_login_method: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Fields§
§id: String§name: String§email: String§email_verified: bool§image: Option<String>§username: Option<String>§display_username: Option<String>§two_factor_enabled: Option<bool>§role: Option<String>§banned: Option<bool>§ban_reason: Option<String>§ban_expires: Option<DateTime<Utc>>§is_anonymous: Option<bool>§phone_number: Option<String>§phone_number_verified: Option<bool>§last_login_method: Option<String>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Trait Implementations§
Source§impl AuthUser for Model
impl AuthUser for Model
Source§fn secondary_snapshot(&self) -> AuthResult<Value>
fn secondary_snapshot(&self) -> AuthResult<Value>
Encode the complete typed model for a trusted secondary backend.
Custom entities can opt in without adding a Deserialize bound to all schemas.
Source§fn from_secondary_snapshot(snapshot: Value) -> AuthResult<Self>
fn from_secondary_snapshot(snapshot: Value) -> AuthResult<Self>
Restore a model from a trusted secondary backend, before public projection.
Source§fn additional_fields(&self) -> FieldOutput
fn additional_fields(&self) -> FieldOutput
Physical application/plugin values; public policy is applied separately.
fn id(&self) -> Cow<'_, str>
fn email(&self) -> Option<&str>
fn name(&self) -> Option<&str>
fn email_verified(&self) -> bool
fn image(&self) -> Option<&str>
fn created_at(&self) -> DateTime<Utc>
fn updated_at(&self) -> DateTime<Utc>
fn username(&self) -> Option<&str>
fn display_username(&self) -> Option<&str>
fn two_factor_enabled(&self) -> bool
Source§fn two_factor_enabled_value(&self) -> Option<bool>
fn two_factor_enabled_value(&self) -> Option<bool>
Persisted plugin state.
None preserves an absent or unset field.fn role(&self) -> Option<&str>
fn banned(&self) -> bool
Source§fn banned_value(&self) -> Option<bool>
fn banned_value(&self) -> Option<bool>
Persisted plugin state.
None preserves an absent or unset field.fn ban_reason(&self) -> Option<&str>
fn ban_expires(&self) -> Option<DateTime<Utc>>
fn metadata(&self) -> &Value
Source§fn is_anonymous(&self) -> Option<bool>
fn is_anonymous(&self) -> Option<bool>
Anonymous-plugin state;
None means the field is absent or unset.fn phone_number_verified(&self) -> Option<bool>
fn phone_number(&self) -> Option<&str>
fn last_login_method(&self) -> Option<&str>
Source§fn adapter_snapshot(&self) -> Option<&AdapterOutput>
fn adapter_snapshot(&self) -> Option<&AdapterOutput>
A genuine retained adapter result, including declared undefined values.
Source§fn retained_user_view(&self) -> Option<&UserView>
fn retained_user_view(&self) -> Option<&UserView>
A chosen authenticated view is already projected and must remain exact.
Source§impl<'a, R: Row> FromRow<'a, R> for Modelwhere
&'a str: ColumnIndex<R>,
String: Decode<'a, R::Database> + Type<R::Database>,
bool: Decode<'a, R::Database> + Type<R::Database>,
Option<String>: Decode<'a, R::Database> + Type<R::Database>,
Option<bool>: Decode<'a, R::Database> + Type<R::Database>,
Option<DateTime<Utc>>: Decode<'a, R::Database> + Type<R::Database>,
DateTime<Utc>: Decode<'a, R::Database> + Type<R::Database>,
impl<'a, R: Row> FromRow<'a, R> for Modelwhere
&'a str: ColumnIndex<R>,
String: Decode<'a, R::Database> + Type<R::Database>,
bool: Decode<'a, R::Database> + Type<R::Database>,
Option<String>: Decode<'a, R::Database> + Type<R::Database>,
Option<bool>: Decode<'a, R::Database> + Type<R::Database>,
Option<DateTime<Utc>>: Decode<'a, R::Database> + Type<R::Database>,
DateTime<Utc>: Decode<'a, R::Database> + Type<R::Database>,
Source§impl SqlxModel for Model
impl SqlxModel for Model
Source§const COLUMN_NAMES: &'static [&'static str]
const COLUMN_NAMES: &'static [&'static str]
The names of
COLUMNS, for select and returning lists.Source§const FIELD_COLUMNS: &'static [(&'static str, &'static str)]
const FIELD_COLUMNS: &'static [(&'static str, &'static str)]
Rust field names paired with their physical columns.
Source§const PRIMARY_KEY: &'static str = "id"
const PRIMARY_KEY: &'static str = "id"
Physical primary-key column.
Source§const PROVIDER_VERIFICATION_COLUMN: Option<&'static str>
const PROVIDER_VERIFICATION_COLUMN: Option<&'static str>
Provider verification column whose SQLite storage may retain raw scalars.
Other model roles and handwritten models retain their existing projection.
Source§fn into_active(self) -> ActiveRow
fn into_active(self) -> ActiveRow
Every column as an unchanged value.
Source§fn from_active(active: ActiveRow) -> AuthResult<Self>
fn from_active(active: ActiveRow) -> AuthResult<Self>
Materialize a model without a database write. Omitted optional fields
become
None; other omitted fields fail. Read moreSource§fn column_value(column: &str, value: SqlValue) -> SqlValue
fn column_value(column: &str, value: SqlValue) -> SqlValue
Apply this physical column’s binding override without changing its Rust
String representation. Ordinary TEXT/VARCHAR columns remain unchanged.
Source§fn timestamp_value(column: &str, value: DateTime<Utc>) -> SqlValue
fn timestamp_value(column: &str, value: DateTime<Utc>) -> SqlValue
Bind the auth UTC clock using this model column’s timestamp wire type.
fn column_kind(column: &str) -> ColumnKind
Source§impl SqlxUserModel for Model
impl SqlxUserModel for Model
Source§fn 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. Read more
Source§fn 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 Read more
fn id_column() -> &'static str
fn email_column() -> &'static str
Source§fn 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>
fn name_column() -> &'static str
fn created_at_column() -> &'static str
Source§fn 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.
fn new_active( id: Option<SqlValue>, create_user: CreateUser, now: DateTime<Utc>, ) -> ActiveRow
fn apply_update(active: &mut ActiveRow, update: UpdateUser, now: DateTime<Utc>)
Source§fn 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. Read more
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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