pub struct ListTab<M> { /* private fields */ }Expand description
One tab a table offers above its rows: a preset predicate the reader picks with
?tab=<key>, beside the search and the filters it combines with.
The first tab is the one a list without ?tab= shows, so a list whose first tab narrows its
rows opens on that tab. A ?tab= naming no tab the table declares is never dropped silently:
the list shows its warning banner, and the export and a selection of every matching record
refuse it, as they do an unknown filter.
A tab narrows what the list shows; it is not access control. A tab whose query reads a field
field_access hides from the user does not show to them:
the panel reads the fields off the query.
use tablo_core::{ListTab, Table, TextColumn, lens};
Table::new(TextColumn::new(lens!(Post.title)))
.tab(ListTab::new("all", "All"))
.tab(
ListTab::new("drafts", "Drafts")
.query(Post::fields().published().eq(false))
.badge(),
);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<M> Forget for ListTab<M>
impl<M> Freeze for ListTab<M>
impl<M> RefUnwindSafe for ListTab<M>
impl<M> Send for ListTab<M>
impl<M> Sync for ListTab<M>
impl<M> Unpin for ListTab<M>
impl<M> UnsafeUnpin for ListTab<M>
impl<M> UnwindSafe for ListTab<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