pub struct Panel {Show 13 fields
pub renderable: DynRenderable,
pub box_style: BoxStyle,
pub title: Option<String>,
pub title_align: AlignMethod,
pub subtitle: Option<String>,
pub subtitle_align: AlignMethod,
pub expand: bool,
pub style: Style,
pub border_style: Style,
pub width: Option<usize>,
pub height: Option<usize>,
pub padding: (usize, usize, usize, usize),
pub highlight: bool,
}Expand description
A renderable that draws a border around its contents.
Fields§
§renderable: DynRenderableThe content inside the panel.
box_style: BoxStyleThe box style defining the border.
title: Option<String>Optional title displayed in the top border.
title_align: AlignMethodAlignment of the title.
subtitle: Option<String>Optional subtitle displayed in the bottom border.
subtitle_align: AlignMethodAlignment of the subtitle.
expand: boolIf true, expand to fill available width.
style: StyleStyle for the content area.
border_style: StyleStyle for the border.
width: Option<usize>Optional fixed width.
height: Option<usize>Optional fixed height.
padding: (usize, usize, usize, usize)Padding (top, right, bottom, left).
highlight: boolIf true, highlight string titles.
Implementations§
Source§impl Panel
impl Panel
Sourcepub fn new(renderable: impl Renderable + Send + Sync + 'static) -> Self
pub fn new(renderable: impl Renderable + Send + Sync + 'static) -> Self
Create a new Panel with the given content.
Sourcepub fn border_style(self, style: Style) -> Self
pub fn border_style(self, style: Style) -> Self
Builder: set the border style.
Sourcepub fn padding(
self,
top: usize,
right: usize,
bottom: usize,
left: usize,
) -> Self
pub fn padding( self, top: usize, right: usize, bottom: usize, left: usize, ) -> Self
Builder: set padding.
Sourcepub fn title_align(self, align: AlignMethod) -> Self
pub fn title_align(self, align: AlignMethod) -> Self
Builder: set title alignment.
Trait Implementations§
Source§impl Renderable for Panel
impl Renderable for Panel
Source§fn render(&self, options: &ConsoleOptions) -> RenderResult
fn render(&self, options: &ConsoleOptions) -> RenderResult
Render this object into a
RenderResult using the provided options. Read moreSource§fn measure(&self, _options: &ConsoleOptions) -> Option<Measurement>
fn measure(&self, _options: &ConsoleOptions) -> Option<Measurement>
Optional width-measurement hook (equivalent to
__rich_measure__).
Override to provide min/max width constraints for layout.Auto Trait Implementations§
impl Freeze for Panel
impl !RefUnwindSafe for Panel
impl Send for Panel
impl Sync for Panel
impl Unpin for Panel
impl UnsafeUnpin for Panel
impl !UnwindSafe 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