pub trait UserSqlLogic {
// Provided methods
fn insert_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn update_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_users<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Vec<User>, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait { ... }
fn is_last_admin<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
fn delete_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait { ... }
}Provided Methods§
Sourcefn insert_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn get_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<User>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn update_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn update_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn get_users<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Vec<User>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
fn get_users<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Vec<User>, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Sourcefn is_last_admin<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn is_last_admin<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn delete_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_user<'life0, 'life1, 'async_trait>(
pool: &'life0 Pool<Postgres>,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SqlError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a user from the database.
§Arguments
pool- The database connection poolusername- The username of the user to delete
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".