pub struct IconColumn<M, T> { /* private fields */ }Expand description
A column of one field shown as an icon in its color, its label read to a screen reader and shown when the pointer rests on it.
The icon and the color are an Options enum’s #[option(icon = …, color = "…")], unless
icon and color say otherwise; a value with no icon shows its
label.
tablo_core::IconColumn::new(tablo_core::lens!(Post.status)).sortable();Implementations§
Source§impl<M, T> IconColumn<M, T>
impl<M, T> IconColumn<M, T>
Sourcepub fn icon(
self,
icon: impl Fn(&T) -> Option<IconData> + Send + Sync + 'static,
) -> Self
pub fn icon( self, icon: impl Fn(&T) -> Option<IconData> + Send + Sync + 'static, ) -> Self
Show icon(value) for the value.
Sourcepub fn color(
self,
color: impl Fn(&T) -> Option<Color> + Send + Sync + 'static,
) -> Self
pub fn color( self, color: impl Fn(&T) -> Option<Color> + Send + Sync + 'static, ) -> Self
Color the icon by color(value).
Sourcepub fn label(self, label: impl Into<Text>) -> Self
pub fn label(self, label: impl Into<Text>) -> Self
Replace the label the field’s name gives it.
Sourcepub fn width(self, width: ColumnWidth) -> Self
pub fn width(self, width: ColumnWidth) -> Self
Declare this column’s width.
Sourcepub fn toggleable(self) -> Self
pub fn toggleable(self) -> Self
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 IconColumn<M, T>
impl<M, T> Clone for IconColumn<M, T>
Source§impl<M, T> Column<M> for IconColumn<M, T>
impl<M, T> Column<M> for IconColumn<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 order_by(&self, descending: bool) -> Option<OrderByExpr>
fn order_by(&self, descending: bool) -> Option<OrderByExpr>
The ordering a sort on this column applies, or
None when the header does not link to a
sort on it. A sortable column answers Some either way.Source§impl<M, T> Debug for IconColumn<M, T>
impl<M, T> Debug for IconColumn<M, T>
impl<M, T> IntoColumns<M> for IconColumn<M, T>where
Self: Column<M> + 'static,
Source§impl<M, T> IntoDetail<M> for IconColumn<M, T>where
Self: Column<M> + 'static,
impl<M, T> IntoDetail<M> for IconColumn<M, T>where
Self: Column<M> + 'static,
fn into_detail(self) -> Detail<M>
Auto Trait Implementations§
impl<M, T> !RefUnwindSafe for IconColumn<M, T>
impl<M, T> !UnwindSafe for IconColumn<M, T>
impl<M, T> Forget for IconColumn<M, T>
impl<M, T> Freeze for IconColumn<M, T>
impl<M, T> Send for IconColumn<M, T>
impl<M, T> Sync for IconColumn<M, T>
impl<M, T> Unpin for IconColumn<M, T>
impl<M, T> UnsafeUnpin for IconColumn<M, T>
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