Trait BasicModel

Source
pub trait BasicModel {
    type ActiveModel: ActiveModelTrait + ActiveModelBehavior + Sized + Send;

    // Provided methods
    fn create<'life0, 'async_trait>(
        db: &'life0 Db,
        data: Self::ActiveModel,
    ) -> Pin<Box<dyn Future<Output = Result<<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn create_many<'life0, 'async_trait>(
        db: &'life0 Db,
        data: Vec<Self::ActiveModel>,
    ) -> Pin<Box<dyn Future<Output = Result<<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn get<'life0, 'async_trait>(
        db: &'life0 Db,
        primary_id: <<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType,
    ) -> Pin<Box<dyn Future<Output = Result<Option<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_by_id<'life0, 'life1, 'async_trait>(
        db: &'life0 Db,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_all<'life0, 'async_trait>(
        db: &'life0 Db,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_all_where<'life0, 'async_trait>(
        db: &'life0 Db,
        conditions: Vec<SimpleExpr>,
        offset: Option<u64>,
        limit: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn update_by_id<'life0, 'life1, 'async_trait>(
        db: &'life0 Db,
        id: &'life1 str,
        data: Self::ActiveModel,
    ) -> Pin<Box<dyn Future<Output = Result<bool, DbErr>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn delete<'life0, 'async_trait>(
        db: &'life0 Db,
        primary_id: <<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType,
    ) -> Pin<Box<dyn Future<Output = Result<bool, DbErr>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn delete_by_id<'life0, 'life1, 'async_trait>(
        db: &'life0 Db,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, DbErr>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn delete_by_ids<'life0, 'async_trait>(
        db: &'life0 Db,
        ids: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Result<u64, DbErr>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
}

Required Associated Types§

Provided Methods§

Source

fn create<'life0, 'async_trait>( db: &'life0 Db, data: Self::ActiveModel, ) -> Pin<Box<dyn Future<Output = Result<<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source

fn create_many<'life0, 'async_trait>( db: &'life0 Db, data: Vec<Self::ActiveModel>, ) -> Pin<Box<dyn Future<Output = Result<<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source

fn get<'life0, 'async_trait>( db: &'life0 Db, primary_id: <<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType, ) -> Pin<Box<dyn Future<Output = Result<Option<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source

fn get_by_id<'life0, 'life1, 'async_trait>( db: &'life0 Db, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_all<'life0, 'async_trait>( db: &'life0 Db, ) -> Pin<Box<dyn Future<Output = Result<Vec<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source

fn get_all_where<'life0, 'async_trait>( db: &'life0 Db, conditions: Vec<SimpleExpr>, offset: Option<u64>, limit: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<Vec<<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source

fn update_by_id<'life0, 'life1, 'async_trait>( db: &'life0 Db, id: &'life1 str, data: Self::ActiveModel, ) -> Pin<Box<dyn Future<Output = Result<bool, DbErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn delete<'life0, 'async_trait>( db: &'life0 Db, primary_id: <<<Self::ActiveModel as ActiveModelTrait>::Entity as EntityTrait>::PrimaryKey as PrimaryKeyTrait>::ValueType, ) -> Pin<Box<dyn Future<Output = Result<bool, DbErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source

fn delete_by_id<'life0, 'life1, 'async_trait>( db: &'life0 Db, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, DbErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn delete_by_ids<'life0, 'async_trait>( db: &'life0 Db, ids: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<u64, DbErr>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl BasicModel for barreleye_common::models::api_key::Model

Source§

impl BasicModel for barreleye_common::models::label::Model

Source§

impl BasicModel for barreleye_common::models::labeled_address::Model

Source§

impl BasicModel for barreleye_common::models::network::Model