pub struct TextColumn<Row, Message> { /* private fields */ }Expand description
A text column — the common provided renderer. value reads just the field it
needs from the row (the per-value default in practice). .numeric()
right-aligns; format precision lives in the value closure.
Implementations§
Source§impl<Row, Message> TextColumn<Row, Message>
impl<Row, Message> TextColumn<Row, Message>
Sourcepub fn new(
id: ColumnId,
title: impl Into<String>,
sizing: impl Into<ColumnSizing>,
value: impl Fn(&Row) -> String + 'static,
) -> Self
pub fn new( id: ColumnId, title: impl Into<String>, sizing: impl Into<ColumnSizing>, value: impl Fn(&Row) -> String + 'static, ) -> Self
A left-aligned text column. sizing accepts a bare width (resizable
with derived bounds — the default shape) or an explicit
ColumnSizing. Sortable by default (ag-grid parity);
opt out with sortable(false).
Adds a footer (aggregate/total) cell: footer is called at render
time, so capture whatever app state holds the totals (the clock
pattern) and the strip stays live.
Sourcepub fn sortable(self, sortable: bool) -> Self
pub fn sortable(self, sortable: bool) -> Self
Sets whether the header is clickable to sort by this column (default:
true). A sort only executes if the store resolves this column’s
field (e.g. VecStore::with_fields) — opt out where it can’t or where
sorting makes no sense (an append-only trace, where arrival order
IS the meaning).
Trait Implementations§
Source§impl<Row, Message: 'static> Column for TextColumn<Row, Message>
impl<Row, Message: 'static> Column for TextColumn<Row, Message>
Source§type Element = Element<'static, Message, Theme, Renderer<Renderer, Renderer>>
type Element = Element<'static, Message, Theme, Renderer<Renderer, Renderer>>
Source§fn sizing(&self) -> ColumnSizing
fn sizing(&self) -> ColumnSizing
Source§fn sortable(&self) -> bool
fn sortable(&self) -> bool
Source§fn header(&self) -> Self::Element
fn header(&self) -> Self::Element
None (the default)
renders no footer cell; a
grid shows its footer strip only when at least one of its columns
provides one (checked once, at grid construction). The aggregation
is integrator-side: footer closures capture whatever app state holds
the totals, and re-render whenever the view does.Source§fn measure(&self, row: &Row) -> Option<Self::Element>
fn measure(&self, row: &Row) -> Option<Self::Element>
cell itself — right wherever the
cell is already content-sized. Override in two situations: the cell
wraps its content in a fill-the-cell container (right/center
alignment does — return the bare content instead), or the cell has
no natural width at all (bars, sparklines — return None, and
auto-size leaves the column’s width alone).footer as rendered; None simply means
there is nothing to measure (no footer, or a fill-width footer like
a bar’s, which should not constrain the fit). Same override rule as
measure: alignment wrappers have no natural
width — return the bare content.Auto Trait Implementations§
impl<Row, Message> !RefUnwindSafe for TextColumn<Row, Message>
impl<Row, Message> !Send for TextColumn<Row, Message>
impl<Row, Message> !Sync for TextColumn<Row, Message>
impl<Row, Message> !UnwindSafe for TextColumn<Row, Message>
impl<Row, Message> Freeze for TextColumn<Row, Message>
impl<Row, Message> Unpin for TextColumn<Row, Message>
impl<Row, Message> UnsafeUnpin for TextColumn<Row, Message>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.