pub struct Summary<M> { /* private fields */ }Expand description
A figure a list shows under its rows: how many records it selects under the reader’s tab, search and filters, across every page, or how many of those a predicate selects.
A summary counts in the database, one count query per summary each time the list renders,
so it reads the whole result set, not the page it shows: mind the cost on a
Pagination::Cursor list too large to count. A summary with no
predicate reuses the count a Pagination::Pages list takes for
its pager, and a list showing no rows counts nothing. Like a ListTab,
it is not access control: a summary whose predicate reads a field
field_access hides from the user does not show to them,
the panel reading the fields off the predicate.
use tablo_core::{Summary, Table, TextColumn, lens};
Table::new(TextColumn::new(lens!(Post.title)))
.summary(Summary::count("Posts"))
.summary(Summary::count("Published").query(Post::fields().published().eq(true)));Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<M> Forget for Summary<M>
impl<M> Freeze for Summary<M>
impl<M> RefUnwindSafe for Summary<M>
impl<M> Send for Summary<M>
impl<M> Sync for Summary<M>
impl<M> Unpin for Summary<M>
impl<M> UnsafeUnpin for Summary<M>
impl<M> UnwindSafe for Summary<M>
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