EntityLoaderTrait

Trait EntityLoaderTrait 

Source
pub trait EntityLoaderTrait<E: EntityTrait>:
    QueryFilter
    + QueryOrder
    + Clone {
    type ModelEx: ModelTrait<Entity = E>;

    // Provided methods
    fn filter_by_id<T>(self, values: T) -> Self
       where T: Into<<E::PrimaryKey as PrimaryKeyTrait>::ValueType> { ... }
    fn order_by_id_asc(self) -> Self { ... }
    fn order_by_id_desc(self) -> Self { ... }
    fn order_by_id(self, order: Order) -> Self { ... }
    fn paginate<'db, C: ConnectionTrait>(
        self,
        db: &'db C,
        page_size: u64,
    ) -> EntityLoaderPaginator<'db, C, E, Self> { ... }
}

Required Associated Types§

Source

type ModelEx: ModelTrait<Entity = E>

The return type of this loader

Provided Methods§

Source

fn filter_by_id<T>(self, values: T) -> Self

Find a model by primary key

Source

fn order_by_id_asc(self) -> Self

Apply order by primary key to the query statement

Source

fn order_by_id_desc(self) -> Self

Apply order by primary key to the query statement

Source

fn order_by_id(self, order: Order) -> Self

Apply order by primary key to the query statement

Source

fn paginate<'db, C: ConnectionTrait>( self, db: &'db C, page_size: u64, ) -> EntityLoaderPaginator<'db, C, E, Self>

Paginate query.

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§