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_user_by_token<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<User>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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;
}

Required Methods§

source

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

source

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

source

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

source

fn fetch_user_by_token<'life0, 'life1, 'async_trait>( &'life0 self, token: &'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 by their session token

source

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

source

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

source

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

source

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

source

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

source

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

source

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.

source

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

source

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

Implementors§