pub trait AbstractUsers: Sync + Send {
Show 13 methods
// Required methods
fn insert_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn fetch_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<User>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn fetch_user_by_username<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 str,
discriminator: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<User>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn fetch_users<'a, 'life0, 'async_trait>(
&'life0 self,
ids: &'a [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<User>>> + Send + 'async_trait>>
where Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait;
fn fetch_discriminators_in_use<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn fetch_mutual_user_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_a: &'life1 str,
user_b: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn fetch_mutual_channel_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_a: &'life1 str,
user_b: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn fetch_mutual_server_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_a: &'life1 str,
user_b: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn update_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
user: &'life2 PartialUser,
remove: Vec<FieldsUser>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn set_relationship<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
target_id: &'life2 str,
relationship: &'life3 RelationshipStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn pull_relationship<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
target_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn clear_user_relationships<'life0, 'life1, 'async_trait>(
&'life0 self,
target_id: &'life1 str,
user_ids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Required Methods§
Sourcefn insert_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert a new user into the database
Sourcefn fetch_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<User>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<User>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch a user from the database
Sourcefn fetch_user_by_username<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 str,
discriminator: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<User>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_user_by_username<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 str,
discriminator: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<User>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch a user from the database by their username
Sourcefn fetch_users<'a, 'life0, 'async_trait>(
&'life0 self,
ids: &'a [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn fetch_users<'a, 'life0, 'async_trait>(
&'life0 self,
ids: &'a [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Fetch multiple users by their ids
Sourcefn fetch_discriminators_in_use<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_discriminators_in_use<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch all discriminators in use for a username
Sourcefn fetch_mutual_user_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_a: &'life1 str,
user_b: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_mutual_user_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_a: &'life1 str,
user_b: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch ids of users that both users are friends with
Sourcefn fetch_mutual_channel_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_a: &'life1 str,
user_b: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_mutual_channel_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_a: &'life1 str,
user_b: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch ids of channels that both users are in
Sourcefn fetch_mutual_server_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_a: &'life1 str,
user_b: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_mutual_server_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_a: &'life1 str,
user_b: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch ids of servers that both users share
Sourcefn update_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
user: &'life2 PartialUser,
remove: Vec<FieldsUser>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
user: &'life2 PartialUser,
remove: Vec<FieldsUser>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update a user by their id given some data
Sourcefn set_relationship<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
target_id: &'life2 str,
relationship: &'life3 RelationshipStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_relationship<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
target_id: &'life2 str,
relationship: &'life3 RelationshipStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Set relationship with another user
This should use pull_relationship if relationship is None.
Sourcefn pull_relationship<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
target_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pull_relationship<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: &'life1 str,
target_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove relationship with another user
Sourcefn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a user by their id
Sourcefn clear_user_relationships<'life0, 'life1, 'async_trait>(
&'life0 self,
target_id: &'life1 str,
user_ids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn clear_user_relationships<'life0, 'life1, 'async_trait>(
&'life0 self,
target_id: &'life1 str,
user_ids: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes all relationships with the user from the list of users
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".