Trait debot_db::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
    ) -> 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 { ... }
}

Required Methods§

source

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,

source

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,

source

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,

source

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,

source

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,

source

fn get_collection_name(&self) -> &str

Provided Methods§

source

fn get_collection(&self, db: &Database) -> Collection<Self>
where Self: Sized,

source

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,

Implementations on Foreign Types§

source§

impl Entity for TradePosition

source§

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,

source§

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,

source§

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,

source§

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,

source§

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: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn get_collection_name(&self) -> &str

Implementors§