pub struct Padding { /* private fields */ }Expand description
Blank space around a child renderable. Mirrors rich.padding.Padding.
The pad is (top, right, bottom, left) — the same order as CSS and upstream.
Implementations§
Source§impl Padding
impl Padding
Sourcepub fn new(
child: Box<dyn Renderable>,
pad: (usize, usize, usize, usize),
) -> Self
pub fn new( child: Box<dyn Renderable>, pad: (usize, usize, usize, usize), ) -> Self
Pad child by an explicit (top, right, bottom, left).
Sourcepub fn uniform(child: Box<dyn Renderable>, amount: usize) -> Self
pub fn uniform(child: Box<dyn Renderable>, amount: usize) -> Self
Equal padding on all four sides.
Trait Implementations§
Source§impl Renderable for Padding
impl Renderable for Padding
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 Padding
impl !Send for Padding
impl !Sync for Padding
impl !UnwindSafe for Padding
impl Freeze for Padding
impl Unpin for Padding
impl UnsafeUnpin for Padding
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