Trait AbstractUsers

Source
pub trait AbstractUsers: Sync + Send {
Show 15 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_session_by_token<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Session>> + 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; fn remove_push_subscription_by_session_id<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_session_last_seen<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, when: Timestamp, ) -> 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_session_by_token<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Session>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a session from the database by 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

Source

fn remove_push_subscription_by_session_id<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove push subscription for a session by session id (TODO: remove)

Source

fn update_session_last_seen<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, when: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§