debot_dbTrait Entity
Source 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,
mode: SearchMode,
limit: Option<u32>,
id: Option<u32>,
) -> 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 { ... }
}