pub struct ListColumn<M, T> { /* private fields */ }Expand description
A column of a Vec of FormScalar values that one list column stores, such as a
multiple choice’s.
A table cell and a detail page show a badge per value, in the stored order: its
FormScalar::to_label, an Options enum’s label with its color or icon,
or any other type’s form spelling. An empty list shows the dash an empty text does. The text,
as an export writes it, joins the labels with , .
tablo_core::ListColumn::new(tablo_core::lens!(Post.keywords));Implementations§
Source§impl<M, T> ListColumn<M, T>where
M: Model,
T: FormScalar,
impl<M, T> ListColumn<M, T>where
M: Model,
T: FormScalar,
Sourcepub fn new(lens: Lens<M, Vec<T>, List<T>>) -> ListColumn<M, T>
pub fn new(lens: Lens<M, Vec<T>, List<T>>) -> ListColumn<M, T>
Bind the column to the list lens reads.
Sourcepub fn label(self, label: impl Into<Text>) -> ListColumn<M, T>
pub fn label(self, label: impl Into<Text>) -> ListColumn<M, T>
Replace the label the field’s name gives it.
Sourcepub fn width(self, width: ColumnWidth) -> ListColumn<M, T>
pub fn width(self, width: ColumnWidth) -> ListColumn<M, T>
Declare this column’s width.
Sourcepub fn toggleable(self) -> ListColumn<M, T>
pub fn toggleable(self) -> ListColumn<M, T>
Let each reader hide this column from their list; it starts shown.
Let each reader show this column in their list; it starts hidden.
Trait Implementations§
Source§impl<M, T> Clone for ListColumn<M, T>
impl<M, T> Clone for ListColumn<M, T>
Source§fn clone(&self) -> ListColumn<M, T>
fn clone(&self) -> ListColumn<M, T>
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 moreSource§impl<M, T> Column<M> for ListColumn<M, T>
impl<M, T> Column<M> for ListColumn<M, T>
Source§fn column_width(&self) -> ColumnWidth
fn column_width(&self) -> ColumnWidth
The width the column claims.
Source§fn toggle(&self) -> ColumnToggle
fn toggle(&self) -> ColumnToggle
Whether each reader may hide or show the column in their list, and how it starts. A
detail page shows every column.
Source§fn search_expr(&self, _term: &str) -> Option<Expr<bool>>
fn search_expr(&self, _term: &str) -> Option<Expr<bool>>
The predicate a search for
term adds, or None when the column does not join the table’s
search. A column that joins it answers Some for every non-empty, trimmed term.Source§impl<M, T> Debug for ListColumn<M, T>
impl<M, T> Debug for ListColumn<M, T>
Source§impl<M, T> IntoColumns<M> for ListColumn<M, T>where
ListColumn<M, T>: Column<M> + 'static,
impl<M, T> IntoColumns<M> for ListColumn<M, T>where
ListColumn<M, T>: Column<M> + 'static,
Source§impl<M, T> IntoDetail<M> for ListColumn<M, T>where
ListColumn<M, T>: Column<M> + 'static,
impl<M, T> IntoDetail<M> for ListColumn<M, T>where
ListColumn<M, T>: Column<M> + 'static,
fn into_detail(self) -> Detail<M>
Auto Trait Implementations§
impl<M, T> Freeze for ListColumn<M, T>
impl<M, T> RefUnwindSafe for ListColumn<M, T>where
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<M, T> Send for ListColumn<M, T>
impl<M, T> Sync for ListColumn<M, T>
impl<M, T> Unpin for ListColumn<M, T>
impl<M, T> UnsafeUnpin for ListColumn<M, T>
impl<M, T> UnwindSafe for ListColumn<M, T>where
M: UnwindSafe,
T: UnwindSafe,
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