pub trait Entity {
// Required methods
fn insert<'life0, 'life1, 'async_trait>(
&'life0 self,
db: &'life1 Database
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
db: &'life1 Database
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
db: &'life1 Database
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_all<'life0, 'life1, 'async_trait>(
&'life0 self,
db: &'life1 Database
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
db: &'life1 Database
) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, Box<dyn Error>>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_collection_name(&self) -> &str;
// Provided methods
fn get_collection(&self, db: &Database) -> Collection<Self>
where Self: Sized { ... }
fn create_unique_index<'life0, 'life1, 'async_trait>(
&'life0 self,
db: &'life1 Database
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + Send + 'async_trait>>
where Self: Sized + Send + Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}