Skip to main content

NewUser

Struct NewUser 

Source
pub struct NewUser {
    pub id: Uuid,
    pub email: String,
    pub display_name: Option<String>,
    pub email_verified: bool,
    pub role: String,
    pub banned: bool,
    pub banned_reason: Option<String>,
    pub banned_until: Option<NaiveDateTime>,
    pub created_at: NaiveDateTime,
    pub updated_at: NaiveDateTime,
}

Fields§

§id: Uuid§email: String§display_name: Option<String>§email_verified: bool§role: String§banned: bool§banned_reason: Option<String>§banned_until: Option<NaiveDateTime>§created_at: NaiveDateTime§updated_at: NaiveDateTime

Trait Implementations§

Source§

impl Clone for NewUser

Source§

fn clone(&self) -> NewUser

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NewUser

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for NewUser

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'insert> Insertable<table> for &'insert NewUser

Source§

type Values = <(Option<Grouped<Eq<id, <&'insert Uuid as AsExpression<<id as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<email, <&'insert String as AsExpression<<email as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<display_name, <&'insert String as AsExpression<<display_name as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<email_verified, <&'insert bool as AsExpression<<email_verified as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<role, <&'insert String as AsExpression<<role as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<banned, <&'insert bool as AsExpression<<banned as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<banned_reason, <&'insert String as AsExpression<<banned_reason as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<banned_until, <&'insert NaiveDateTime as AsExpression<<banned_until as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<created_at, <&'insert NaiveDateTime as AsExpression<<created_at as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<updated_at, <&'insert NaiveDateTime as AsExpression<<updated_at as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values

The VALUES clause to insert these records Read more
Source§

fn values( self, ) -> <(Option<Eq<id, &'insert Uuid>>, Option<Eq<email, &'insert String>>, Option<Eq<display_name, &'insert String>>, Option<Eq<email_verified, &'insert bool>>, Option<Eq<role, &'insert String>>, Option<Eq<banned, &'insert bool>>, Option<Eq<banned_reason, &'insert String>>, Option<Eq<banned_until, &'insert NaiveDateTime>>, Option<Eq<created_at, &'insert NaiveDateTime>>, Option<Eq<updated_at, &'insert NaiveDateTime>>) as Insertable<table>>::Values

Construct Self::Values Read more
Source§

fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>
where T: Table, Self: Sized,

Insert self into a given table. Read more
Source§

impl Insertable<table> for NewUser

Source§

type Values = <(Option<Grouped<Eq<id, <Uuid as AsExpression<<id as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<email, <String as AsExpression<<email as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<display_name, <String as AsExpression<<display_name as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<email_verified, <bool as AsExpression<<email_verified as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<role, <String as AsExpression<<role as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<banned, <bool as AsExpression<<banned as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<banned_reason, <String as AsExpression<<banned_reason as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<banned_until, <NaiveDateTime as AsExpression<<banned_until as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<created_at, <NaiveDateTime as AsExpression<<created_at as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<updated_at, <NaiveDateTime as AsExpression<<updated_at as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values

The VALUES clause to insert these records Read more
Source§

fn values( self, ) -> <(Option<Eq<id, Uuid>>, Option<Eq<email, String>>, Option<Eq<display_name, String>>, Option<Eq<email_verified, bool>>, Option<Eq<role, String>>, Option<Eq<banned, bool>>, Option<Eq<banned_reason, String>>, Option<Eq<banned_until, NaiveDateTime>>, Option<Eq<created_at, NaiveDateTime>>, Option<Eq<updated_at, NaiveDateTime>>) as Insertable<table>>::Values

Construct Self::Values Read more
Source§

fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>
where T: Table, Self: Sized,

Insert self into a given table. Read more
Source§

impl Serialize for NewUser

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl UndecoratedInsertRecord<table> for NewUser

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,