pub struct Panel { /* private fields */ }Expand description
A bordered box around a renderable. Mirrors rich.panel.Panel.
Implementations§
Source§impl Panel
impl Panel
Sourcepub fn new(child: Box<dyn Renderable>) -> Self
pub fn new(child: Box<dyn Renderable>) -> Self
A panel around child with default box (ROUNDED) and padding (0,1).
Sourcepub fn title(self, title: impl Into<String>) -> Self
pub fn title(self, title: impl Into<String>) -> Self
Set a title (drawn into the top border, centered by default).
Sourcepub fn title_align(self, align: HorizontalAlign) -> Self
pub fn title_align(self, align: HorizontalAlign) -> Self
Set the title alignment within the top border.
Sourcepub fn subtitle(self, subtitle: impl Into<String>) -> Self
pub fn subtitle(self, subtitle: impl Into<String>) -> Self
Set a subtitle (drawn into the bottom border, centered by default).
Sourcepub fn subtitle_align(self, align: HorizontalAlign) -> Self
pub fn subtitle_align(self, align: HorizontalAlign) -> Self
Set the subtitle alignment within the bottom border.
Sourcepub fn padding(self, padding: (usize, usize, usize, usize)) -> Self
pub fn padding(self, padding: (usize, usize, usize, usize)) -> Self
Set the inner padding (top, right, bottom, left).
Sourcepub fn border_style(self, style: Style) -> Self
pub fn border_style(self, style: Style) -> Self
Set the border style.
Trait Implementations§
Source§impl Renderable for Panel
impl Renderable for Panel
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 Panel
impl !Send for Panel
impl !Sync for Panel
impl !UnwindSafe for Panel
impl Freeze for Panel
impl Unpin for Panel
impl UnsafeUnpin for Panel
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