DatabaseConnection

Trait DatabaseConnection 

Source
pub trait DatabaseConnection<'a>: DatabaseConnectionRequirements {
    type Connection: 'a;

    // Required methods
    fn open<'life0, 'life1, 'async_trait>(
        name: &'life0 str,
        key: &'life1 DatabaseKey,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Self>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn open_in_memory<'life0, 'async_trait>(
        key: &'life0 DatabaseKey,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Self>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_key<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        new_key: &'life1 DatabaseKey,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn wipe<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait;

    // Provided method
    fn check_buffer_size(size: usize) -> CryptoKeystoreResult<()> { ... }
}

Required Associated Types§

Required Methods§

Source

fn open<'life0, 'life1, 'async_trait>( name: &'life0 str, key: &'life1 DatabaseKey, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn open_in_memory<'life0, 'async_trait>( key: &'life0 DatabaseKey, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn update_key<'life0, 'life1, 'async_trait>( &'life0 mut self, new_key: &'life1 DatabaseKey, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn wipe<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,

Clear all data from the database and close it.

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> DatabaseConnection<'a> for SqlCipherConnection

Source§

type Connection = MutexGuard<'a, Connection>