pub trait Asynchronous {
    // Required methods
    fn set<'life0, 'async_trait, T>(
        &'life0 self,
        key: T,
        value: T
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where T: AsRef<str> + Send + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn get<'life0, 'async_trait, T>(
        &'life0 self,
        key: T
    ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
       where T: AsRef<str> + Send + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'async_trait, T>(
        &'life0 self,
        key: T
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where T: AsRef<str> + Send + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn list<'life0, 'async_trait, T>(
        &'life0 self,
        prefix: Option<T>
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
       where T: AsRef<str> + Send + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Asynchronous support for Database struct. Use this trait by import it then use it right away!

Required Methods§

source

fn set<'life0, 'async_trait, T>( &'life0 self, key: T, value: T ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where T: AsRef<str> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Set a variable. key and value MUST implement AsRef<str>. (str and String implemented this.). Possible Exception is ErrorKind::HttpError for HttpError

source

fn get<'life0, 'async_trait, T>( &'life0 self, key: T ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where T: AsRef<str> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Get a variable you just set. key MUST implement AsRef<str>. (str and String implemented this.). Possible Exceptions are ErrorKind::HttpError for HttpError, ErrorKind::NoItemFoundError for no items were found in the database

source

fn delete<'life0, 'async_trait, T>( &'life0 self, key: T ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where T: AsRef<str> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Delete a variable you just set. MUST implement AsRef<str>. (str and String implemented this.). Possible Exceptions are ErrorKind::HttpError for HttpError, ErrorKind::NoItemFoundError for no items were found in the database

source

fn list<'life0, 'async_trait, T>( &'life0 self, prefix: Option<T> ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
where T: AsRef<str> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

List variables. Optionally finding variable that contains defined prefix by passing Some with anything that implements AsRef<str>. (str and String implemented this.) or STRING_NONE. Possible Exceptions are ErrorKind::HttpError for HttpError, ErrorKind::DecodeError Decoding string error.

Object Safety§

This trait is not object safe.

Implementors§