pub struct SectionBuilder<'a> { /* private fields */ }Expand description
Builder returned by Table::add_section and Table::add_separator.
Implementations§
Source§impl<'a> SectionBuilder<'a>
impl<'a> SectionBuilder<'a>
Sourcepub fn align(self, align: Align) -> Self
pub fn align(self, align: Align) -> Self
Set the alignment for the section label.
Examples found in repository?
examples/styled.rs (line 24)
3fn main() {
4 let mut table = Table::with_columns(vec![
5 Column::new("Name")
6 .bright_cyan()
7 .bold()
8 .width(ColumnWidth::fill()),
9 Column::new("Role").width(0.5).truncate(Trunc::Middle),
10 Column::new("Status").bright_yellow().bold().width(0.3),
11 ])
12 .with_section_style(SectionStyle {
13 horiz: "═",
14 mid_left: "╞",
15 mid_right: "╡",
16 mid_joint: "╪",
17 })
18 .with_separator_style(SectionStyle {
19 horiz: "╌",
20 mid_joint: "│",
21 ..SectionStyle::unicode()
22 });
23
24 table.add_section("Team").align(Align::Center);
25 table.add_row(vec![
26 Cell::new("Ada Lovelace"),
27 Cell::new("Principal Engineer"),
28 Cell::new("Active").bright_green(),
29 ]);
30
31 table.add_separator();
32 table.add_row(vec![
33 Cell::new("Bob"),
34 Cell::new("Support"),
35 Cell::new("Away"),
36 ]);
37
38 println!("{}", table);
39}Sourcepub fn style(self, style: SectionStyle) -> Self
pub fn style(self, style: SectionStyle) -> Self
Set the border style used when rendering this section or separator.
Auto Trait Implementations§
impl<'a> Freeze for SectionBuilder<'a>
impl<'a> RefUnwindSafe for SectionBuilder<'a>
impl<'a> Send for SectionBuilder<'a>
impl<'a> Sync for SectionBuilder<'a>
impl<'a> Unpin for SectionBuilder<'a>
impl<'a> UnsafeUnpin for SectionBuilder<'a>
impl<'a> !UnwindSafe for SectionBuilder<'a>
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