pub trait DatabaseAdapter<T: Send + Sync + Serialize + DeserializeOwned + 'static>: Send + Sync {
// Required methods
fn insert<'life0, 'async_trait>(
&'life0 self,
data: T,
) -> Pin<Box<dyn Future<Output = Result<String, CoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn insert_many<'life0, 'async_trait>(
&'life0 self,
data: Vec<T>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, CoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upsert<'life0, 'async_trait>(
&'life0 self,
data: T,
) -> Pin<Box<dyn Future<Output = Result<String, CoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upsert_many<'life0, 'async_trait>(
&'life0 self,
data: Vec<T>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, CoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_one<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, CoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_all<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, CoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_one_and_update<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
update: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, CoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_many<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
update: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_one<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_many<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
fn insert<'life0, 'async_trait>(
&'life0 self,
data: T,
) -> Pin<Box<dyn Future<Output = Result<String, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn insert_many<'life0, 'async_trait>(
&'life0 self,
data: Vec<T>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert<'life0, 'async_trait>(
&'life0 self,
data: T,
) -> Pin<Box<dyn Future<Output = Result<String, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_many<'life0, 'async_trait>(
&'life0 self,
data: Vec<T>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_one<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_all<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_one_and_update<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
update: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_many<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
update: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_one<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_many<'life0, 'async_trait>(
&'life0 self,
filter: QueryBuilder,
) -> Pin<Box<dyn Future<Output = Result<(), CoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".