pub struct Columns { /* private fields */ }Expand description
Arranges items into a grid of columns. Mirrors rich.columns.Columns.
Implementations§
Source§impl Columns
impl Columns
Sourcepub fn new(items: Vec<String>) -> Self
pub fn new(items: Vec<String>) -> Self
Columns of string items with the default padding (0, 1). Each string
is console markup, converted with the console’s defaults (markup, emoji
and highlighting), as upstream’s console.render_str(renderable) does.
Sourcepub fn from_cells(items: Vec<Cell>) -> Self
pub fn from_cells(items: Vec<Cell>) -> Self
Columns of any items: markup strings, literal Text
or renderables, as upstream’s Columns(renderables) accepts.
Trait Implementations§
Source§impl Renderable for Columns
impl Renderable for Columns
fn rich_render( &self, console: &Console, options: &ConsoleOptions, ) -> Vec<Segment>
Source§fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
The
(minimum, maximum) cell width this renderable wants. The default
assumes the renderable fills the available width (e.g. Panel, Table);
Text overrides it with its content width so the top-level print path can
shrink to fit. Port of __rich_measure__ / Measurement.get.Source§fn fit_to_measurement(&self) -> bool
fn fit_to_measurement(&self) -> bool
Whether a top-level
Console::print shrinks this renderable to its
measured width. Upstream renders every top-level renderable at the full
console width, so the default is false; an extension may opt in.Auto Trait Implementations§
impl !RefUnwindSafe for Columns
impl !UnwindSafe for Columns
impl Freeze for Columns
impl Send for Columns
impl Sync for Columns
impl Unpin for Columns
impl UnsafeUnpin for Columns
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