pub struct PaginationState { /* private fields */ }Expand description
Complete pagination state for the table.
Tracks the current page, page size, available options, and provides navigation methods.
Implementations§
Source§impl PaginationState
impl PaginationState
Sourcepub const DEFAULT_PAGE_SIZE: usize = 10
pub const DEFAULT_PAGE_SIZE: usize = 10
Default page size.
Sourcepub const DEFAULT_PAGE_SIZE_OPTIONS: &'static [usize]
pub const DEFAULT_PAGE_SIZE_OPTIONS: &'static [usize]
Default page size options.
Sourcepub fn new() -> PaginationState
pub fn new() -> PaginationState
Creates a new pagination state with default settings.
§Returns
PaginationState: A new pagination state with page size 10 and enabled.
Sourcepub fn disabled() -> PaginationState
pub fn disabled() -> PaginationState
Sourcepub fn with_page_size(self, size: usize) -> PaginationState
pub fn with_page_size(self, size: usize) -> PaginationState
Sourcepub fn with_page_size_options(self, options: Vec<usize>) -> PaginationState
pub fn with_page_size_options(self, options: Vec<usize>) -> PaginationState
Sourcepub fn with_mode(self, mode: PaginationMode) -> PaginationState
pub fn with_mode(self, mode: PaginationMode) -> PaginationState
Sourcepub fn with_total_rows(self, total: usize) -> PaginationState
pub fn with_total_rows(self, total: usize) -> PaginationState
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Sourcepub fn page_index(&self) -> usize
pub fn page_index(&self) -> usize
Sourcepub fn page_number(&self) -> usize
pub fn page_number(&self) -> usize
Sourcepub fn mode(&self) -> PaginationMode
pub fn mode(&self) -> PaginationMode
Sourcepub fn page_size_options(&self) -> &[usize]
pub fn page_size_options(&self) -> &[usize]
Sourcepub fn page_count(&self, row_count: usize) -> usize
pub fn page_count(&self, row_count: usize) -> usize
Sourcepub fn start_index(&self) -> usize
pub fn start_index(&self) -> usize
Sourcepub fn can_go_previous(&self) -> bool
pub fn can_go_previous(&self) -> bool
Returns whether there is a previous page.
§Returns
bool: Whether navigation to a previous page is possible.
Sourcepub fn can_go_next(&self, row_count: usize) -> bool
pub fn can_go_next(&self, row_count: usize) -> bool
Sourcepub fn go_to_first(&mut self)
pub fn go_to_first(&mut self)
Goes to the first page.
Sourcepub fn go_to_last(&mut self, row_count: usize)
pub fn go_to_last(&mut self, row_count: usize)
Sourcepub fn go_to_previous(&mut self)
pub fn go_to_previous(&mut self)
Goes to the previous page.
Sourcepub fn go_to_next(&mut self, row_count: usize)
pub fn go_to_next(&mut self, row_count: usize)
Sourcepub fn go_to_page(&mut self, index: usize, row_count: usize)
pub fn go_to_page(&mut self, index: usize, row_count: usize)
Goes to a specific page (0-based index).
§Parameters
index: The zero-based page index to navigate to.row_count: The total number of rows.
Sourcepub fn set_page_size(&mut self, size: usize, row_count: usize)
pub fn set_page_size(&mut self, size: usize, row_count: usize)
Sets the page size and adjusts the current page if needed.
§Parameters
size: The new page size.row_count: The total number of rows.
Sourcepub fn set_total_rows(&mut self, total: usize)
pub fn set_total_rows(&mut self, total: usize)
Sets the total row count (for server-side pagination).
§Parameters
total: The total number of rows on the server.
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PaginationState
impl Debug for PaginationState
Source§impl Default for PaginationState
Provides a default pagination state with standard settings.
impl Default for PaginationState
Provides a default pagination state with standard settings.
Source§fn default() -> PaginationState
fn default() -> PaginationState
Returns the “default value” for a type. Read more
Source§impl PartialEq for PaginationState
impl PartialEq for PaginationState
impl Eq for PaginationState
impl StructuralPartialEq for PaginationState
Auto Trait Implementations§
impl Freeze for PaginationState
impl RefUnwindSafe for PaginationState
impl Send for PaginationState
impl Sync for PaginationState
impl Unpin for PaginationState
impl UnsafeUnpin for PaginationState
impl UnwindSafe 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.