Struct mostro_core::user::User
source · pub struct User {
pub id: Uuid,
pub pubkey: String,
pub is_admin: i64,
pub is_solver: i64,
pub is_banned: i64,
pub category: i64,
pub created_at: i64,
}Expand description
Database representation of an user
Fields§
§id: Uuid§pubkey: String§is_admin: i64§is_solver: i64§is_banned: i64§category: i64§created_at: i64Implementations§
Trait Implementations§
source§impl<'e> Crud<'e, &'e Pool<Sqlite>> for User
impl<'e> Crud<'e, &'e Pool<Sqlite>> for User
source§fn insert_binds(
&'e self,
query: QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
) -> QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
fn insert_binds( &'e self, query: QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments> ) -> QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
source§fn update_binds(
&'e self,
query: QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
) -> QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
fn update_binds( &'e self, query: QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments> ) -> QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
source§fn create(
&'e self,
pool: E
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + 'e>>
fn create( &'e self, pool: E ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + 'e>>
Returns a future that resolves to an insert or
sqlx::Error of the
current instance. Read moresource§fn all(
pool: E
) -> TryCollect<Pin<Box<dyn Stream<Item = Result<Self, Error>> + Send + 'e>>, Vec<Self>>
fn all( pool: E ) -> TryCollect<Pin<Box<dyn Stream<Item = Result<Self, Error>> + Send + 'e>>, Vec<Self>>
Queries all records from the table and returns a future that returns
to a try_collect stream, which resolves to a
Vec<Self> or a
sqlx::Error on error. Read moresource§fn by_id(
pool: E,
id: Self::Id
) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + 'e>>
fn by_id( pool: E, id: Self::Id ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + 'e>>
Looks up a row by ID and returns a future that resolves an
Option<Self>. Returns None if and a record with the corresponding ID
cannot be found and Some if it exists. Read moresource§impl<'de> Deserialize<'de> for User
impl<'de> Deserialize<'de> for User
source§fn 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
source§impl PartialEq for User
impl PartialEq for User
source§impl Schema for User
impl Schema for User
source§fn table_name() -> &'static str
fn table_name() -> &'static str
Database name of the table. Used by the query generation code and
available for introspection. This is generated by taking the plural
snake_case of the struct’s name. See: Inflector to_table_case. Read more
source§fn select_sql() -> &'static str
fn select_sql() -> &'static str
Returns the SQL string for a SELECT query against the table. Read more
source§fn select_by_id_sql() -> &'static str
fn select_by_id_sql() -> &'static str
Returns the SQL string for a SELECT query against the table with a
WHERE clause for the primary key. Read more
source§fn insert_sql() -> &'static str
fn insert_sql() -> &'static str
Returns the SQL for inserting a new record in to the database. The
#[external_id] attribute may be used to specify IDs are assigned
outside of the database. Read moresource§fn update_by_id_sql() -> &'static str
fn update_by_id_sql() -> &'static str
Returns the SQL for updating an existing record in the database. Read more
source§fn delete_by_id_sql() -> &'static str
fn delete_by_id_sql() -> &'static str
Returns the SQL for deleting an existing record by ID from the database. Read more
impl Eq for User
impl StructuralEq for User
impl StructuralPartialEq for 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§
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.