Skip to main content

Database

Trait Database 

Source
pub trait Database:
    Sized
    + Clone
    + Send
    + Sync
    + 'static {
Show 13 methods // Required methods fn new<'life0, 'async_trait>( settings: &'life0 DbSettings, ) -> Pin<Box<dyn Future<Output = DbResult<Self>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_session<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = DbResult<Session>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_session_user<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = DbResult<User>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn add_session<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 NewSession, ) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_user<'life0, 'life1, 'async_trait>( &'life0 self, username: &'life1 str, ) -> Pin<Box<dyn Future<Output = DbResult<User>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_user_session<'life0, 'life1, 'async_trait>( &'life0 self, u: &'life1 User, ) -> Pin<Box<dyn Future<Output = DbResult<Session>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn add_user<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 NewUser, ) -> Pin<Box<dyn Future<Output = DbResult<i64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_user_password<'life0, 'life1, 'async_trait>( &'life0 self, u: &'life1 User, ) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_user<'life0, 'life1, 'async_trait>( &'life0 self, u: &'life1 User, ) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_store<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 User, ) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn add_records<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user: &'life1 User, record: &'life2 [Record<EncryptedData>], ) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn next_records<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 User, host: HostId, tag: String, start: Option<RecordIdx>, count: u64, ) -> Pin<Box<dyn Future<Output = DbResult<Vec<Record<EncryptedData>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn status<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 User, ) -> Pin<Box<dyn Future<Output = DbResult<RecordStatus>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait;
}

Required Methods§

Source

fn new<'life0, 'async_trait>( settings: &'life0 DbSettings, ) -> Pin<Box<dyn Future<Output = DbResult<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_session<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = DbResult<Session>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_session_user<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = DbResult<User>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn add_session<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 NewSession, ) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_user<'life0, 'life1, 'async_trait>( &'life0 self, username: &'life1 str, ) -> Pin<Box<dyn Future<Output = DbResult<User>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_user_session<'life0, 'life1, 'async_trait>( &'life0 self, u: &'life1 User, ) -> Pin<Box<dyn Future<Output = DbResult<Session>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn add_user<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 NewUser, ) -> Pin<Box<dyn Future<Output = DbResult<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_user_password<'life0, 'life1, 'async_trait>( &'life0 self, u: &'life1 User, ) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn delete_user<'life0, 'life1, 'async_trait>( &'life0 self, u: &'life1 User, ) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn delete_store<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 User, ) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn add_records<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user: &'life1 User, record: &'life2 [Record<EncryptedData>], ) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn next_records<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 User, host: HostId, tag: String, start: Option<RecordIdx>, count: u64, ) -> Pin<Box<dyn Future<Output = DbResult<Vec<Record<EncryptedData>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn status<'life0, 'life1, 'async_trait>( &'life0 self, user: &'life1 User, ) -> Pin<Box<dyn Future<Output = DbResult<RecordStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§