Skip to main content

TextColumn

Struct TextColumn 

Source
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>

Source

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).

Source

pub fn footer(self, footer: impl Fn() -> String + 'static) -> Self

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.

Source

pub fn numeric(self) -> Self

Right-aligns the cell text — the numeric variant.

Source

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>

Source§

type Element = Element<'static, Message, Theme, Renderer<Renderer, Renderer>>

Opaque element type — the core never constructs or inspects it.
Source§

type Row = Row

The row this column reads from.
Source§

fn id(&self) -> ColumnId

This column’s stable identity.
Source§

fn sizing(&self) -> ColumnSizing

This column’s sizing policy.
Source§

fn sortable(&self) -> bool

Whether clicking this column’s header sorts by it. The column only declares sortability (a view property); the store executes the sort (the spec/execution straddle). Read more
Source§

fn header(&self) -> Self::Element

The header element (label + sort indicator + resize-handle area).
Source§

fn cell(&self, row: &Row) -> Self::Element

The cell element for row.
Source§

fn footer(&self) -> Option<Self::Element>

The footer element — aggregates/totals. 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>

A measurement-friendly rendering of the cell, for auto-size: an element whose natural (shrink) width IS the content width. The default measures 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).
The footer’s measurement-friendly rendering — auto-size fits the footer too (a total is often wider than any cell). The default measures 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>
where Box<dyn Fn(&Row) -> String>: Freeze, PhantomData<fn() -> Message>: Freeze,

§

impl<Row, Message> Unpin for TextColumn<Row, Message>
where Box<dyn Fn(&Row) -> String>: Unpin, PhantomData<fn() -> Message>: Unpin,

§

impl<Row, Message> UnsafeUnpin for TextColumn<Row, Message>
where Box<dyn Fn(&Row) -> String>: UnsafeUnpin, PhantomData<fn() -> Message>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<State, Message> IntoBoot<State, Message> for State

Source§

fn into_boot(self) -> (State, Task<Message>)

Turns some type into the initial state of some Application.
Source§

impl<T> MaybeClone for T

Source§

impl<T> MaybeDebug for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more