pub struct Database { /* private fields */ }
Expand description
Database main struct.
Please use this database with traits. (Availables are Synchronous
and Asynchronous
)
Implementations§
Trait Implementations§
source§impl Asynchronous for Database
impl Asynchronous for Database
source§fn set<'life0, 'async_trait, T>(
&'life0 self,
key: T,
value: T
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
fn set<'life0, 'async_trait, T>( &'life0 self, key: T, value: T ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
Set a variable.
key
and value
MUST implement AsRef<str>
. (str
and String
implemented this.).
Possible Exception is ErrorKind::HttpError
for HttpErrorsource§fn get<'life0, 'async_trait, T>(
&'life0 self,
key: T
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
fn get<'life0, 'async_trait, T>( &'life0 self, key: T ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + '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 databasesource§fn delete<'life0, 'async_trait, T>(
&'life0 self,
key: T
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
fn delete<'life0, 'async_trait, T>( &'life0 self, key: T ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '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 databasesource§fn list<'life0, 'async_trait, T>(
&'life0 self,
prefix: Option<T>
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + '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>>
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.source§impl Synchronous for Database
impl Synchronous for Database
source§fn set(&self, key: impl AsRef<str>, value: impl AsRef<str>) -> Result<(), Error>
fn set(&self, key: impl AsRef<str>, value: impl AsRef<str>) -> Result<(), Error>
Set a variable.
key
and value
MUST implement AsRef<str>
. (str
and String
implemented this.).
Possible Exception is ErrorKind::HttpError
for HttpErrorsource§fn get(&self, key: impl AsRef<str>) -> Result<String, Error>
fn get(&self, key: impl AsRef<str>) -> Result<String, Error>
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 databasesource§fn delete(&self, key: impl AsRef<str>) -> Result<(), Error>
fn delete(&self, key: impl AsRef<str>) -> Result<(), Error>
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 databasesource§fn list(&self, prefix: Option<impl AsRef<str>>) -> Result<Vec<String>, Error>
fn list(&self, prefix: Option<impl AsRef<str>>) -> Result<Vec<String>, Error>
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.Auto Trait Implementations§
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more