pub struct Constrain { /* private fields */ }Expand description
Limits a child renderable to at most width cells. Mirrors rich.constrain.Constrain.
Implementations§
Trait Implementations§
Source§impl Renderable for Constrain
impl Renderable for Constrain
Source§fn measure(&self, console: &Console, options: &ConsoleOptions) -> Measurement
fn measure(&self, console: &Console, options: &ConsoleOptions) -> Measurement
Port of Constrain.__rich_measure__: the child measured within the
constraint (Measurement.get then caps it at the outer width).
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.Source§fn vertical(&self) -> Option<VerticalAlign>
fn vertical(&self) -> Option<VerticalAlign>
The vertical alignment a
Table cell holding this renderable uses in
place of its column’s. Upstream reads getattr(renderable, "vertical", None); Align sets it.Source§fn print_end_line(&self, _options: &ConsoleOptions) -> bool
fn print_end_line(&self, _options: &ConsoleOptions) -> bool
Whether a top-level print ends this renderable’s last line. This
port’s renderables separate lines, where upstream’s end each line
with
"\n", so a print adds the final line break. A renderable
whose upstream output stops without one (Screen, LiveRender, a
Rule whose end has no newline) returns false, and the next
output continues its last line. options are the print’s options.Auto Trait Implementations§
impl !RefUnwindSafe for Constrain
impl !Send for Constrain
impl !Sync for Constrain
impl !UnwindSafe for Constrain
impl Freeze for Constrain
impl Unpin for Constrain
impl UnsafeUnpin for Constrain
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