[][src]Struct paginator::PaginatorBuilder

pub struct PaginatorBuilder {
    pub total_pages: usize,
    pub current_page: usize,
    pub max_item_count: usize,
    pub start_size: usize,
    pub end_size: usize,
    pub has_prev: bool,
    pub has_next: bool,
}

A struct to create Paginator or PaginatorIter.

Fields

total_pages: usize

The number of pages.

current_page: usize

The number of the current page.

max_item_count: usize

The max number of PageItems after generated.

start_size: usize

The number of PageItems (the PageItem::Prev item is excluded) on the start edge (before the first PageItem::Ignore item).

end_size: usize

The number of PageItems (the PageItem::Next item is excluded) on the end edge (after the last PageItem::Ignore item).

has_prev: bool

Whether to add the PageItem::Prev item.

has_next: bool

Whether to add the PageItem::Next item.

Implementations

impl PaginatorBuilder[src]

pub const fn new(total_pages: usize) -> PaginatorBuilder[src]

Create a new PageConfigBuilder with some default options.

PageConfigBuilder {
    total_pages: <total_pages>,
    current_page: 1,
    max_item_count: 9,
    start_size: 1,
    end_size: 1,
    has_prev: true,
    has_next: true,
}

pub const fn total_pages(self, total_pages: usize) -> PaginatorBuilder[src]

Set the number of pages.

pub const fn current_page(self, current_page: usize) -> PaginatorBuilder[src]

Set the number of the current page.

pub const fn max_item_count(self, max_item_count: usize) -> PaginatorBuilder[src]

Set the max number of PageItems after generated.

pub const fn start_size(self, start_size: usize) -> PaginatorBuilder[src]

Set the number of PageItems (the PageItem::Prev item is excluded) on the start edge (before the first PageItem::Ignore item).

pub const fn end_size(self, end_size: usize) -> PaginatorBuilder[src]

Set the number of PageItems (the PageItem::Next item is excluded) on the end edge (after the last PageItem::Ignore item).

pub const fn has_prev(self, has_prev: bool) -> PaginatorBuilder[src]

Set whether to add the PageItem::Prev item.

pub const fn has_next(self, has_next: bool) -> PaginatorBuilder[src]

Set whether to add the PageItem::Next item.

impl PaginatorBuilder[src]

Trait Implementations

impl Clone for PaginatorBuilder[src]

impl Debug for PaginatorBuilder[src]

impl Eq for PaginatorBuilder[src]

impl PartialEq<PaginatorBuilder> for PaginatorBuilder[src]

impl StructuralEq for PaginatorBuilder[src]

impl StructuralPartialEq for PaginatorBuilder[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.