pub struct Align { /* private fields */ }Expand description
Aligns a child renderable within the available width. Mirrors rich.align.Align.
Implementations§
Source§impl Align
impl Align
Sourcepub fn left(child: Box<dyn Renderable>) -> Self
pub fn left(child: Box<dyn Renderable>) -> Self
Left-align the child (pads on the right).
Sourcepub fn center(child: Box<dyn Renderable>) -> Self
pub fn center(child: Box<dyn Renderable>) -> Self
Center the child (pads both sides, extra cell on the right).
Sourcepub fn right(child: Box<dyn Renderable>) -> Self
pub fn right(child: Box<dyn Renderable>) -> Self
Right-align the child (pads on the left).
Trait Implementations§
Source§impl Renderable for Align
impl Renderable for Align
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.Auto Trait Implementations§
impl !RefUnwindSafe for Align
impl !Send for Align
impl !Sync for Align
impl !UnwindSafe for Align
impl Freeze for Align
impl Unpin for Align
impl UnsafeUnpin for Align
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