pub struct PaginationControls {
pub page_count_error: Signal<Option<String>>,
pub current_page: Signal<usize>,
pub start_range: Signal<Vec<usize>>,
pub end_range: Signal<Vec<usize>>,
pub current_range: Signal<Vec<usize>>,
pub show_separator_before: Signal<bool>,
pub show_separator_after: Signal<bool>,
}Expand description
Return type of use_pagination_controls. It provides a bunch of signals to easily build a pagination component.
Please note that all ranges are inclusive. This means that the start and end of each range are included in the range. Also counting starts from 0. The first page is 0.
Fields§
§page_count_error: Signal<Option<String>>If the page count couldn’t be determined, this signal will contain an error message.
current_page: Signal<usize>§start_range: Signal<Vec<usize>>The range of pages at the start of the pagination.
In many cases this will be 0 to margin_page_count.
But if the current range is too close or overlaps then this start range with be extended so it includes the current range. The current range will then be returned as empty.
If there are so few pages that all the ranges (start, end, current) need to be merged into one range then they will all be merged into this start range and they will be returned emtpy.
end_range: Signal<Vec<usize>>The range of pages at the end of the pagination.
In many cases this will be total_pages - margin_page_count to total_pages.
But if the current range is too close or overlaps then this end range with be extended so it includes the current range. The current range will then be returned as empty.
If there are so few pages that all the ranges (start, end, current) need to be merged into one range then they will all be merged into the start range and this will be empty.
current_range: Signal<Vec<usize>>The current range of pages. This will be empty if the current range is too close to the start or the end. In this case the range will be merged with the start or end range.
show_separator_before: Signal<bool>Whether to show a separator (usually an ellipsis “…”) before the current range.
show_separator_after: Signal<bool>Whether to show a separator (usually an ellipsis “…”) after the current range.
Trait Implementations§
Source§impl Clone for PaginationControls
impl Clone for PaginationControls
Source§fn clone(&self) -> PaginationControls
fn clone(&self) -> PaginationControls
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PaginationControls
impl Debug for PaginationControls
impl Copy for PaginationControls
Auto Trait Implementations§
impl Freeze for PaginationControls
impl RefUnwindSafe for PaginationControls
impl Send for PaginationControls
impl Sync for PaginationControls
impl Unpin for PaginationControls
impl UnwindSafe for PaginationControls
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more