Struct create_rust_app::auth::User  
source · [−]pub struct User {
    pub id: i32,
    pub email: String,
    pub hash_password: String,
    pub activated: bool,
    pub created_at: DateTime<Utc>,
    pub updated_at: DateTime<Utc>,
}Fields
id: i32email: Stringhash_password: Stringactivated: boolcreated_at: DateTime<Utc>updated_at: DateTime<Utc>Implementations
sourceimpl User
 
impl User
pub fn create(db: &Connection, item: &UserChangeset) -> QueryResult<Self>
pub fn read(db: &Connection, item_id: i32) -> QueryResult<Self>
pub fn find_by_email(db: &Connection, item_email: String) -> QueryResult<Self>
pub fn read_all(
    db: &Connection, 
    pagination: &PaginationParams
) -> QueryResult<Vec<Self>>
pub fn update(
    db: &Connection, 
    item_id: i32, 
    item: &UserChangeset
) -> QueryResult<Self>
pub fn delete(db: &Connection, item_id: i32) -> QueryResult<usize>
Trait Implementations
sourceimpl<'update> AsChangeset for &'update User
 
impl<'update> AsChangeset for &'update User
type Target = table
type Target = table
The table which Self::Changeset will be updating
type Changeset = <(Eq<email, <&'update String as AsExpression<<email as Expression>::SqlType>>::Expression>, Eq<hash_password, <&'update String as AsExpression<<hash_password as Expression>::SqlType>>::Expression>, Eq<activated, <&'update bool as AsExpression<<activated as Expression>::SqlType>>::Expression>, Eq<created_at, <&'update DateTime<Utc> as AsExpression<<created_at as Expression>::SqlType>>::Expression>, Eq<updated_at, <&'update DateTime<Utc> as AsExpression<<updated_at as Expression>::SqlType>>::Expression>) as AsChangeset>::Changeset
type Changeset = <(Eq<email, <&'update String as AsExpression<<email as Expression>::SqlType>>::Expression>, Eq<hash_password, <&'update String as AsExpression<<hash_password as Expression>::SqlType>>::Expression>, Eq<activated, <&'update bool as AsExpression<<activated as Expression>::SqlType>>::Expression>, Eq<created_at, <&'update DateTime<Utc> as AsExpression<<created_at as Expression>::SqlType>>::Expression>, Eq<updated_at, <&'update DateTime<Utc> as AsExpression<<updated_at as Expression>::SqlType>>::Expression>) as AsChangeset>::Changeset
The update statement this type represents
sourcefn as_changeset(self) -> Self::Changeset
 
fn as_changeset(self) -> Self::Changeset
Convert self into the actual update statement being executed
sourceimpl<'update> AsChangeset for User
 
impl<'update> AsChangeset for User
type Target = table
type Target = table
The table which Self::Changeset will be updating
type Changeset = <(Eq<email, <String as AsExpression<<email as Expression>::SqlType>>::Expression>, Eq<hash_password, <String as AsExpression<<hash_password as Expression>::SqlType>>::Expression>, Eq<activated, <bool as AsExpression<<activated as Expression>::SqlType>>::Expression>, Eq<created_at, <DateTime<Utc> as AsExpression<<created_at as Expression>::SqlType>>::Expression>, Eq<updated_at, <DateTime<Utc> as AsExpression<<updated_at as Expression>::SqlType>>::Expression>) as AsChangeset>::Changeset
type Changeset = <(Eq<email, <String as AsExpression<<email as Expression>::SqlType>>::Expression>, Eq<hash_password, <String as AsExpression<<hash_password as Expression>::SqlType>>::Expression>, Eq<activated, <bool as AsExpression<<activated as Expression>::SqlType>>::Expression>, Eq<created_at, <DateTime<Utc> as AsExpression<<created_at as Expression>::SqlType>>::Expression>, Eq<updated_at, <DateTime<Utc> as AsExpression<<updated_at as Expression>::SqlType>>::Expression>) as AsChangeset>::Changeset
The update statement this type represents
sourcefn as_changeset(self) -> Self::Changeset
 
fn as_changeset(self) -> Self::Changeset
Convert self into the actual update statement being executed
sourceimpl<__FK> BelongsTo<User> for UserPermission where
    __FK: Hash + Eq,
    for<'__a> &'__a i32: Into<Option<&'__a __FK>>,
    for<'__a> &'__a User: Identifiable<Id = &'__a __FK>, 
 
impl<__FK> BelongsTo<User> for UserPermission where
    __FK: Hash + Eq,
    for<'__a> &'__a i32: Into<Option<&'__a __FK>>,
    for<'__a> &'__a User: Identifiable<Id = &'__a __FK>, 
type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
type ForeignKeyColumn = user_id
type ForeignKeyColumn = user_id
The database column representing the foreign key of the table this struct represents Read more
sourcefn foreign_key(&self) -> Option<&Self::ForeignKey>
 
fn foreign_key(&self) -> Option<&Self::ForeignKey>
Returns the foreign key for self
sourcefn foreign_key_column() -> Self::ForeignKeyColumn
 
fn foreign_key_column() -> Self::ForeignKeyColumn
Returns the foreign key column of this struct’s table
sourceimpl<__FK> BelongsTo<User> for UserSession where
    __FK: Hash + Eq,
    for<'__a> &'__a i32: Into<Option<&'__a __FK>>,
    for<'__a> &'__a User: Identifiable<Id = &'__a __FK>, 
 
impl<__FK> BelongsTo<User> for UserSession where
    __FK: Hash + Eq,
    for<'__a> &'__a i32: Into<Option<&'__a __FK>>,
    for<'__a> &'__a User: Identifiable<Id = &'__a __FK>, 
type ForeignKey = __FK
type ForeignKey = __FK
The foreign key of this struct
type ForeignKeyColumn = user_id
type ForeignKeyColumn = user_id
The database column representing the foreign key of the table this struct represents Read more
sourcefn foreign_key(&self) -> Option<&Self::ForeignKey>
 
fn foreign_key(&self) -> Option<&Self::ForeignKey>
Returns the foreign key for self
sourcefn foreign_key_column() -> Self::ForeignKeyColumn
 
fn foreign_key_column() -> Self::ForeignKeyColumn
Returns the foreign key column of this struct’s table
sourceimpl<'de> Deserialize<'de> for User
 
impl<'de> Deserialize<'de> for User
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'ident> Identifiable for &'ident User
 
impl<'ident> Identifiable for &'ident User
Auto Trait Implementations
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnwindSafe for User
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    T: ?Sized, 
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> IntoSql for T
 
impl<T> IntoSql for T
sourcefn into_sql<T>(self) -> Self::Expression where
    Self: AsExpression<T>, 
 
fn into_sql<T>(self) -> Self::Expression where
    Self: AsExpression<T>, 
Convert self to an expression for Diesel’s query builder. Read more
sourcefn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
    &'a Self: AsExpression<T>, 
 
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
    &'a Self: AsExpression<T>, 
Convert &self to an expression for Diesel’s query builder. Read more
sourceimpl<T> ToOwned for T where
    T: Clone, 
 
impl<T> ToOwned for T where
    T: Clone, 
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
 
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more