pub trait PaginatorTrait<'db, C>where
    C: ConnectionTrait,{
    type Selector: SelectorTrait + Send + Sync + 'db;

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

    // Provided method
    fn count<'async_trait>(
        self,
        db: &'db C
    ) -> Pin<Box<dyn Future<Output = Result<u64, DbErr>> + Send + 'async_trait>>
       where Self: Send + Sized + Send + 'async_trait,
             'db: 'async_trait { ... }
}
Expand description

A Trait for any type that can paginate results

Required Associated Types§

source

type Selector: SelectorTrait + Send + Sync + '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<'async_trait>( self, db: &'db C ) -> Pin<Box<dyn Future<Output = Result<u64, DbErr>> + Send + 'async_trait>>where Self: Send + Sized + Send + 'async_trait, 'db: 'async_trait,

Perform a count on the paginated results

Implementors§

source§

impl<'db, C, M, E> PaginatorTrait<'db, C> for Select<E>where C: ConnectionTrait, E: EntityTrait<Model = M>, M: FromQueryResult + Sized + Send + Sync + '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 + Send + Sync + 'db, N: FromQueryResult + Sized + Send + Sync + 'db,

source§

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

§

type Selector = S

source§

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

§

type Selector = S