Skip to main content

SelectPage

Trait SelectPage 

Source
pub trait SelectPage<E, C>{
    // Required method
    fn select_page<'life0, 'async_trait>(
        self,
        db: &'life0 C,
        p: Option<PaginationParam>,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<E::Model>, u64)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Available on crate feature api only.
Expand description

Extension for SeaORM Select: execute a query with optional pagination and get back (items, total_count).

Required Methods§

Source

fn select_page<'life0, 'async_trait>( self, db: &'life0 C, p: Option<PaginationParam>, ) -> Pin<Box<dyn Future<Output = Result<(Vec<E::Model>, u64)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch one page when p is given, or the whole result set (with its length as total) otherwise.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<M, E, C> SelectPage<E, C> for Select<E>
where E: EntityTrait<Model = M>, M: FromQueryResult + Sized + Send + Sync, C: ConnectionTrait,

Source§

fn select_page<'life0, 'async_trait>( self, db: &'life0 C, p: Option<PaginationParam>, ) -> Pin<Box<dyn Future<Output = Result<(Vec<E::Model>, u64)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§