pub struct User {
pub id: i64,
pub username: String,
pub password_hash: String,
pub is_active: bool,
pub is_staff: bool,
pub is_admin: bool,
pub is_superuser: bool,
}Fields§
§id: i64§username: String§password_hash: String§is_active: bool§is_staff: bool§is_admin: bool§is_superuser: boolImplementations§
Source§impl User
impl User
pub const ID: ModelField<Self, i64>
pub const USERNAME: ModelField<Self, String>
pub const PASSWORD_HASH: ModelField<Self, String>
pub const IS_ACTIVE: ModelField<Self, bool>
pub const IS_STAFF: ModelField<Self, bool>
pub const IS_ADMIN: ModelField<Self, bool>
pub const IS_SUPERUSER: ModelField<Self, bool>
Trait Implementations§
Source§impl From<User> for AdminUserSerializer
impl From<User> for AdminUserSerializer
Source§impl Model for User
impl Model for User
type PrimaryKey = i64
fn table_name() -> &'static str
fn columns() -> &'static [&'static str]
Source§fn primary_key() -> ModelField<Self, Self::PrimaryKey>
fn primary_key() -> ModelField<Self, Self::PrimaryKey>
Returns the model’s typed primary-key field.
fn primary_key_value(&self) -> Self::PrimaryKey
fn schema() -> TableSchema
fn from_row(row: &Row) -> Result<Self, DecodeError>
fn from_row_at(row: &Row, offset: usize) -> Result<Self, DecodeError>
fn insert_values(&self) -> Vec<InsertValue>
Source§fn field_values(&self) -> Vec<InsertValue>
fn field_values(&self) -> Vec<InsertValue>
Materialized field values keyed by physical SQL column, independently of
Serde naming. Unlike insert values, these include generated keys and
managed timestamps. The derive generates a complete implementation;
manual models with managed fields should override this method.
Source§fn write_protected_columns() -> &'static [&'static str]
fn write_protected_columns() -> &'static [&'static str]
Physical columns that must not accept untrusted write values. The derive
includes
ImageField and Option<ImageField>; trusted ORM writes remain
available for validated uploads. External write adapters enforce this
metadata, just as ModelSerializer enforces image read-only behavior.Source§fn json_columns() -> &'static [&'static str]
fn json_columns() -> &'static [&'static str]
TEXT-backed JSON columns retain their JSON type in external codecs.
fn managed_update_values() -> Vec<Assignment>
Source§fn model_name() -> &'static str
fn model_name() -> &'static str
Stable Rust model name used by migration state. It is deliberately
independent from
table_name() so table renames keep model identity.Source§fn from_sqlite_row(row: &Row<'_>) -> Result<Self, Error>
fn from_sqlite_row(row: &Row<'_>) -> Result<Self, Error>
Adapter for direct SQLite driver queries.
fn query() -> SelectQuery<Self>
fn insert() -> InsertQuery<Self>
fn update() -> UpdateQuery<Self>
fn delete() -> DeleteQuery<Self>
fn create_table() -> CreateTableQuery<Self>
Auto Trait Implementations§
impl Forget for User
impl Freeze for User
impl Move for User
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnsafeUnpin for User
impl UnwindSafe for User
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