Trait AbstractServers

Source
pub trait AbstractServers: Sync + Send {
    // Required methods
    fn insert_server<'life0, 'life1, 'async_trait>(
        &'life0 self,
        server: &'life1 Server,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn fetch_server<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Server>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn fetch_servers<'a, 'life0, 'async_trait>(
        &'life0 self,
        ids: &'a [String],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Server>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;
    fn update_server<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        partial: &'life2 PartialServer,
        remove: Vec<FieldsServer>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete_server<'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 insert_role<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        server_id: &'life1 str,
        role_id: &'life2 str,
        role: &'life3 Role,
    ) -> 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 update_role<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        server_id: &'life1 str,
        role_id: &'life2 str,
        partial: &'life3 PartialRole,
        remove: Vec<FieldsRole>,
    ) -> 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 delete_role<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        server_id: &'life1 str,
        role_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;
}

Required Methods§

Source

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

Insert a new server into database

Source

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

Fetch a server by its id

Source

fn fetch_servers<'a, 'life0, 'async_trait>( &'life0 self, ids: &'a [String], ) -> Pin<Box<dyn Future<Output = Result<Vec<Server>>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Fetch a servers by their ids

Source

fn update_server<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 str, partial: &'life2 PartialServer, remove: Vec<FieldsServer>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Update a server with new information

Source

fn delete_server<'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 server by its id

Source

fn insert_role<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, server_id: &'life1 str, role_id: &'life2 str, role: &'life3 Role, ) -> 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,

Insert a new role into server object

Source

fn update_role<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, server_id: &'life1 str, role_id: &'life2 str, partial: &'life3 PartialRole, remove: Vec<FieldsRole>, ) -> 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,

Update an existing role on a server

Source

fn delete_role<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, server_id: &'life1 str, role_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,

Delete a role from a server

Also updates channels and members.

Implementors§