PaginatorTrait

Trait PaginatorTrait 

Source
pub trait PaginatorTrait<'db, C>
where C: ConnectionTrait,
{ type Selector: SelectorTrait + 'db; // Required method fn paginate( self, db: &'db C, page_size: u64, ) -> Paginator<'db, C, Self::Selector>; // Provided methods fn count(self, db: &'db C) -> Result<u64, DbErr> where Self: Sized { ... } fn exists(self, db: &'db C) -> Result<bool, DbErr> where Self: Sized { ... } }
Expand description

A Trait for any type that can paginate results

Required Associated Typesยง

Source

type Selector: SelectorTrait + 'db

Select operation

Required Methodsยง

Source

fn paginate( self, db: &'db C, page_size: u64, ) -> Paginator<'db, C, Self::Selector>

Paginate the result of a select operation.

Provided Methodsยง

Source

fn count(self, db: &'db C) -> Result<u64, DbErr>
where Self: Sized,

Perform a count on the paginated results

Source

fn exists(self, db: &'db C) -> Result<bool, DbErr>
where Self: Sized,

Check if any records exist

Implementorsยง

Sourceยง

impl<'db, C, EE, FF, GG, HH, E, F, G, H, TOP> PaginatorTrait<'db, C> for SelectFour<E, F, G, H, TOP>
where C: ConnectionTrait, E: EntityTrait<Model = EE>, F: EntityTrait<Model = FF>, G: EntityTrait<Model = GG>, H: EntityTrait<Model = HH>, EE: FromQueryResult + Sized + 'db, FF: FromQueryResult + Sized + 'db, GG: FromQueryResult + Sized + 'db, HH: FromQueryResult + Sized + 'db, TOP: Topology,

Sourceยง

type Selector = SelectFourModel<EE, FF, GG, HH>

Sourceยง

impl<'db, C, EE, FF, GG, HH, II, E, F, G, H, I, TOP> PaginatorTrait<'db, C> for SelectFive<E, F, G, H, I, TOP>
where C: ConnectionTrait, E: EntityTrait<Model = EE>, F: EntityTrait<Model = FF>, G: EntityTrait<Model = GG>, H: EntityTrait<Model = HH>, I: EntityTrait<Model = II>, EE: FromQueryResult + Sized + 'db, FF: FromQueryResult + Sized + 'db, GG: FromQueryResult + Sized + 'db, HH: FromQueryResult + Sized + 'db, II: FromQueryResult + Sized + 'db, TOP: Topology,

Sourceยง

type Selector = SelectFiveModel<EE, FF, GG, HH, II>

Sourceยง

impl<'db, C, EE, FF, GG, HH, II, JJ, E, F, G, H, I, J, TOP> PaginatorTrait<'db, C> for SelectSix<E, F, G, H, I, J, TOP>
where C: ConnectionTrait, E: EntityTrait<Model = EE>, F: EntityTrait<Model = FF>, G: EntityTrait<Model = GG>, H: EntityTrait<Model = HH>, I: EntityTrait<Model = II>, J: EntityTrait<Model = JJ>, EE: FromQueryResult + Sized + 'db, FF: FromQueryResult + Sized + 'db, GG: FromQueryResult + Sized + 'db, HH: FromQueryResult + Sized + 'db, II: FromQueryResult + Sized + 'db, JJ: FromQueryResult + Sized + 'db, TOP: Topology,

Sourceยง

type Selector = SelectSixModel<EE, FF, GG, HH, II, JJ>

Sourceยง

impl<'db, C, M, E> PaginatorTrait<'db, C> for Select<E>
where C: ConnectionTrait, E: EntityTrait<Model = M>, M: FromQueryResult + Sized + 'db,

Sourceยง

impl<'db, C, M, N, E, F> PaginatorTrait<'db, C> for SelectTwo<E, F>
where C: ConnectionTrait, E: EntityTrait<Model = M>, F: EntityTrait<Model = N>, M: FromQueryResult + Sized + 'db, N: FromQueryResult + Sized + 'db,

Sourceยง

impl<'db, C, M, N, O, E, F, G, TOP> PaginatorTrait<'db, C> for SelectThree<E, F, G, TOP>
where C: ConnectionTrait, E: EntityTrait<Model = M>, F: EntityTrait<Model = N>, G: EntityTrait<Model = O>, M: FromQueryResult + Sized + 'db, N: FromQueryResult + Sized + 'db, O: FromQueryResult + Sized + 'db, TOP: Topology,

Sourceยง

impl<'db, C, S> PaginatorTrait<'db, C> for Selector<S>
where C: ConnectionTrait, S: SelectorTrait + 'db,

Sourceยง

impl<'db, C, S> PaginatorTrait<'db, C> for SelectorRaw<S>
where C: ConnectionTrait, S: SelectorTrait + 'db,