[−][src]Struct paginator::PaginatorBuilder
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 PageItem
s after generated.
start_size: usize
The number of PageItem
s (the PageItem::Prev
item is excluded) on the start edge (before the first PageItem::Ignore
item).
end_size: usize
The number of PageItem
s (the PageItem::Next
item is excluded) on the end edge (after the last PageItem::Ignore
item).
has_prev: YesNoDepends
Whether to add the PageItem::Prev
item.
has_next: YesNoDepends
Whether to add the PageItem::Next
item.
Implementations
impl PaginatorBuilder
[src]
pub const fn new(total_pages: usize) -> PaginatorBuilder
[src]
Create a new PaginatorBuilder
with some default options.
PaginatorBuilder { total_pages, // this is input by the caller. current_page: 1, max_item_count: 9, start_size: 1, end_size: 1, has_prev: YesNoDepends::Depends, has_next: YesNoDepends::Depends, }
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 PageItem
s after generated.
pub const fn start_size(self, start_size: usize) -> PaginatorBuilder
[src]
Set the number of PageItem
s (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 PageItem
s (the PageItem::Next
item is excluded) on the end edge (after the last PageItem::Ignore
item).
pub const fn has_prev(self, has_prev: YesNoDepends) -> PaginatorBuilder
[src]
Set whether to add the PageItem::Prev
item.
pub const fn has_next(self, has_next: YesNoDepends) -> PaginatorBuilder
[src]
Set whether to add the PageItem::Next
item.
impl PaginatorBuilder
[src]
pub fn build_paginator(self) -> Result<Paginator, PaginatorBuildError>
[src]
pub fn build_paginator_iter(self) -> Result<PaginatorIter, PaginatorBuildError>
[src]
Trait Implementations
impl Clone for PaginatorBuilder
[src]
fn clone(&self) -> PaginatorBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PaginatorBuilder
[src]
impl Eq for PaginatorBuilder
[src]
impl PartialEq<PaginatorBuilder> for PaginatorBuilder
[src]
fn eq(&self, other: &PaginatorBuilder) -> bool
[src]
fn ne(&self, other: &PaginatorBuilder) -> bool
[src]
impl StructuralEq for PaginatorBuilder
[src]
impl StructuralPartialEq for PaginatorBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for PaginatorBuilder
impl Send for PaginatorBuilder
impl Sync for PaginatorBuilder
impl Unpin for PaginatorBuilder
impl UnwindSafe for PaginatorBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,