pub struct PaginationState { /* private fields */ }Expand description
The controlled behavior shared by every part of a pagination control.
Implementations§
Source§impl PaginationState
impl PaginationState
pub fn new(current_page: usize, total_pages: usize) -> Self
pub fn visible_pages(self, visible_pages: usize) -> Self
pub fn disabled(self, disabled: bool) -> Self
Sourcepub fn on_change(
self,
handler: impl Fn(usize, &mut Window, &mut App) + 'static,
) -> Self
pub fn on_change( self, handler: impl Fn(usize, &mut Window, &mut App) + 'static, ) -> Self
Handles a requested page change.
Unlike the element-level controls, this is a model-level request that may also come from the keyboard or from application code, so it does not carry a pointer event.
pub fn current_page(&self) -> usize
pub fn total_pages(&self) -> usize
pub fn is_disabled(&self) -> bool
pub fn has_on_change(&self) -> bool
pub fn previous_page(&self) -> Option<usize>
pub fn next_page(&self) -> Option<usize>
Sourcepub fn request_page(&self, page: usize, window: &mut Window, cx: &mut App)
pub fn request_page(&self, page: usize, window: &mut Window, cx: &mut App)
Requests a controlled page change after applying the shared disabled, bounds, and current-page guards.
pub fn items(&self) -> Vec<PaginationItem>
Trait Implementations§
Source§impl Clone for PaginationState
impl Clone for PaginationState
Source§fn clone(&self) -> PaginationState
fn clone(&self) -> PaginationState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PaginationState
impl !Send for PaginationState
impl !Sync for PaginationState
impl !UnwindSafe for PaginationState
impl Freeze for PaginationState
impl Unpin for PaginationState
impl UnsafeUnpin for PaginationState
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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