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
Source§fn measure(&self, console: &Console, options: &ConsoleOptions) -> Measurement
fn measure(&self, console: &Console, options: &ConsoleOptions) -> Measurement
Port of Align.__rich_measure__: the child’s measurement.
fn rich_render( &self, console: &Console, options: &ConsoleOptions, ) -> Vec<Segment>
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 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