pub enum Cell {
Text(Text),
Markup(String),
Renderable(Arc<dyn Renderable + Send + Sync>),
}Expand description
A table cell: a markup string, styled text, or any renderable (upstream accepts all three).
Variants§
Text(Text)
A text cell, rendered literally (a Text is never re-parsed); its own
justify, overflow and no_wrap override the column’s.
Markup(String)
A plain string, which upstream renders through Console.render_str:
console markup and emoji codes are applied, and the column’s
highlight decides whether it is highlighted. Pass Cell::Text for
data that must stay literal.
Renderable(Arc<dyn Renderable + Send + Sync>)
A renderable cell, measured with __rich_measure__ and rendered at the
column width, as upstream’s Padding(renderable) cell is.
Trait Implementations§
Source§impl From<&str> for Cell
A string cell is console markup, as upstream’s str renderables are:
"[b]x" renders a bold x, and a stray [ in data can restyle, link or
hide what follows. For data you do not control (file names, model or
column names, user input) pass a Text instead, as upstream’s
add_row(Text(name)) does: Cell::from(Text::new(name)), which is never
parsed.
impl From<&str> for Cell
A string cell is console markup, as upstream’s str renderables are:
"[b]x" renders a bold x, and a stray [ in data can restyle, link or
hide what follows. For data you do not control (file names, model or
column names, user input) pass a Text instead, as upstream’s
add_row(Text(name)) does: Cell::from(Text::new(name)), which is never
parsed.