pub struct PaginatedTable { /* private fields */ }Expand description
Renders a large number of rows with automatic pagination.
When total <= max_visible, all rows are shown. Otherwise, the first
head_count rows, a summary row (“… N more …”), and the last
tail_count rows are displayed.
Implementations§
Source§impl PaginatedTable
impl PaginatedTable
Sourcepub fn new(max_visible: usize, head_count: usize, tail_count: usize) -> Self
pub fn new(max_visible: usize, head_count: usize, tail_count: usize) -> Self
Create with custom thresholds.
Sourcepub fn render<F>(
self,
builder: TableBuilder,
total: usize,
col_count: usize,
row_fn: F,
) -> TableBuilder
pub fn render<F>( self, builder: TableBuilder, total: usize, col_count: usize, row_fn: F, ) -> TableBuilder
Render rows into the given TableBuilder.
row_fn(index) returns (cells, status) for the row at index (0-based).
col_count is the number of columns (used for the summary row span).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PaginatedTable
impl RefUnwindSafe for PaginatedTable
impl Send for PaginatedTable
impl Sync for PaginatedTable
impl Unpin for PaginatedTable
impl UnsafeUnpin for PaginatedTable
impl UnwindSafe for PaginatedTable
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> 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