Struct elephantry::Pager[][src]

pub struct Pager<E: Entity> { /* fields omitted */ }

This struct is created by the Connection::paginate_find_where method.

Implementations

impl<E: Entity> Pager<E>[src]

pub fn new(
    rows: Rows<E>,
    count: usize,
    page: usize,
    max_per_page: usize
) -> Self
[src]

Creates a new pager.

page starts at 1.

pub fn result_count(&self) -> usize[src]

Get the number of results in this page.

pub fn result_min(&self) -> usize[src]

Get the index of the first element of this page.

pub fn result_max(&self) -> usize[src]

Get the index of the last element of this page.

pub fn last_page(&self) -> usize[src]

Get the last page index.

pub fn page(&self) -> usize[src]

Get the current page index.

pub fn has_next_page(&self) -> bool[src]

True if a next page exists.

pub fn has_previous_page(&self) -> bool[src]

True if a previous page exists.

pub fn count(&self) -> usize[src]

Get the total number of results in all pages.

pub fn max_per_page(&self) -> usize[src]

Get maximum result per page.

pub fn rows(&self) -> &Rows<E>

Notable traits for Rows<E>

impl<E: Entity> Iterator for Rows<E> type Item = E;
[src]

Get results rows.

Trait Implementations

impl<E: Debug + Entity> Debug for Pager<E>[src]

impl<E: Entity> IntoIterator for Pager<E>[src]

type IntoIter = Rows<Self::Item>

Which kind of iterator are we turning this into?

type Item = E

The type of the elements being iterated over.

Auto Trait Implementations

impl<E> !RefUnwindSafe for Pager<E>

impl<E> Send for Pager<E> where
    E: Send

impl<E> !Sync for Pager<E>

impl<E> Unpin for Pager<E> where
    E: Unpin

impl<E> UnwindSafe for Pager<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.