pub struct FieldColumn<M, T, P = T> { /* private fields */ }Expand description
One field of a model, as the PanelModel derive’s
columns() hands it over: Product::columns().qty.
Placed as it is, in a Table or on a Detail page, it is the column the
derive picks for the field’s type there, with the field’s #[columns(..)] keys applied: the
column the model’s default table or detail page shows. A kind method, such as
text, date or toggle, is that column type’s
own builder over the field instead, labelled by the field’s #[columns(label = "..")]; each
compiles only for a field type its column reads.
use tablo_core::Table;
let columns = Product::columns();
Table::new((
// The derive's pick: a sortable, searchable text.
columns.name,
// A text column of the derive's, reshaped.
columns.qty.text().numeric(0).sortable(),
// A switch saving the record as it flips, in place of the derive's yes or no.
columns.active.toggle(),
));lens hands over the field’s Lens for a filter, a tab or a field access
rule; lens! builds one for a path the derive does not reach, such as an
embedded value’s own field.
Implementations§
Source§impl<M, T, P> FieldColumn<M, T, P>
impl<M, T, P> FieldColumn<M, T, P>
Source§impl<M, T> FieldColumn<M, T>
impl<M, T> FieldColumn<M, T>
Sourcepub fn text(self) -> TextColumn<M, T>
pub fn text(self) -> TextColumn<M, T>
A TextColumn: the value’s text, or an Options enum’s label.
Sourcepub fn icon(self) -> IconColumn<M, T>
pub fn icon(self) -> IconColumn<M, T>
An IconColumn: an Options enum’s icon in place of its label.
Sourcepub fn text_input(self) -> TextInputColumn<M, T>
pub fn text_input(self) -> TextInputColumn<M, T>
A TextInputColumn: a text input saving the record as it changes.
Source§impl<M, T> FieldColumn<M, T>where
M: Model,
T: DateValue,
impl<M, T> FieldColumn<M, T>where
M: Model,
T: DateValue,
Sourcepub fn date(self) -> DateColumn<M, T>
pub fn date(self) -> DateColumn<M, T>
A DateColumn: the value’s calendar day.
Source§impl<M, T> FieldColumn<M, T>
impl<M, T> FieldColumn<M, T>
Sourcepub fn select(self) -> SelectColumn<M, T>
pub fn select(self) -> SelectColumn<M, T>
A SelectColumn: a select over the enum’s options, saving the record as it
changes.
Source§impl<M, T> FieldColumn<M, T>where
M: Model,
T: Field<Inner = String>,
impl<M, T> FieldColumn<M, T>where
M: Model,
T: Field<Inner = String>,
Sourcepub fn color(self) -> ColorColumn<M, T>
pub fn color(self) -> ColorColumn<M, T>
A ColorColumn: a swatch of the CSS color the text holds.
Sourcepub fn image(self) -> ImageColumn<M, T>
pub fn image(self) -> ImageColumn<M, T>
An ImageColumn: the image the text names.
Sourcepub fn rich_text(self) -> RichTextColumn<M, T>
pub fn rich_text(self) -> RichTextColumn<M, T>
A RichTextColumn: the cleaned HTML the text holds.
Source§impl<M> FieldColumn<M, bool>where
M: Model,
impl<M> FieldColumn<M, bool>where
M: Model,
Sourcepub fn boolean(self) -> BooleanColumn<M>
pub fn boolean(self) -> BooleanColumn<M>
A BooleanColumn: a yes or no.
Sourcepub fn toggle(self) -> ToggleColumn<M>
pub fn toggle(self) -> ToggleColumn<M>
A ToggleColumn: a switch saving the record as it flips.
Source§impl<M> FieldColumn<M, String>where
M: Model,
impl<M> FieldColumn<M, String>where
M: Model,
Sourcepub fn file(self) -> FileColumn<M>
pub fn file(self) -> FileColumn<M>
A FileColumn: a link to the upload the text names.
Source§impl<M, T> FieldColumn<M, T>where
M: Model,
T: EmbeddedForm,
impl<M, T> FieldColumn<M, T>where
M: Model,
T: EmbeddedForm,
Sourcepub fn embedded(self) -> EmbeddedColumn<M, T>
pub fn embedded(self) -> EmbeddedColumn<M, T>
An EmbeddedColumn: the embedded value’s leaves.
Source§impl<M, T> FieldColumn<M, Vec<T>, List<T>>where
M: Model,
T: FormScalar,
impl<M, T> FieldColumn<M, Vec<T>, List<T>>where
M: Model,
T: FormScalar,
Sourcepub fn list(self) -> ListColumn<M, T>
pub fn list(self) -> ListColumn<M, T>
A ListColumn: a badge per value.
Source§impl<M, T> FieldColumn<M, Vec<T>, List<T>>where
M: Model,
T: FormInput,
impl<M, T> FieldColumn<M, Vec<T>, List<T>>where
M: Model,
T: FormInput,
Sourcepub fn repeater(self) -> RepeaterColumn<M, T>
pub fn repeater(self) -> RepeaterColumn<M, T>
A RepeaterColumn: the list’s items.
Trait Implementations§
Source§impl<M, T, P> Clone for FieldColumn<M, T, P>
impl<M, T, P> Clone for FieldColumn<M, T, P>
Source§fn clone(&self) -> FieldColumn<M, T, P>
fn clone(&self) -> FieldColumn<M, T, P>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<M, T, P> From<FieldColumn<M, T, P>> for Lens<M, T, P>
impl<M, T, P> From<FieldColumn<M, T, P>> for Lens<M, T, P>
Source§fn from(column: FieldColumn<M, T, P>) -> Lens<M, T, P>
fn from(column: FieldColumn<M, T, P>) -> Lens<M, T, P>
Source§impl<M, T, P> IntoColumns<M> for FieldColumn<M, T, P>
The table column the derive picks, or none for a field only a detail page shows.
impl<M, T, P> IntoColumns<M> for FieldColumn<M, T, P>
The table column the derive picks, or none for a field only a detail page shows.
Source§impl<M, T, P> IntoDetail<M> for FieldColumn<M, T, P>
The detail page column the derive picks.
impl<M, T, P> IntoDetail<M> for FieldColumn<M, T, P>
The detail page column the derive picks.