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 21)
3fn main() {
4 let mut table = Table::with_columns(vec![
5 Column::new("Name").bright_cyan().bold().width(0.3),
6 Column::new("Role").width(0.4).truncate(Trunc::Middle),
7 Column::new("Status").bright_yellow().bold().width(0.3),
8 ])
9 .with_section_style(SectionStyle {
10 horiz: "═",
11 mid_left: "╞",
12 mid_right: "╡",
13 mid_joint: "╪",
14 })
15 .with_separator_style(SectionStyle {
16 horiz: "╌",
17 mid_joint: "│",
18 ..SectionStyle::unicode()
19 });
20
21 table.add_section("Team").align(Align::Center);
22 table.add_row(vec![
23 Cell::new("Ada Lovelace"),
24 Cell::new("Principal Engineer"),
25 Cell::new("Active").bright_green(),
26 ]);
27
28 table.add_separator();
29 table.add_row(vec![
30 Cell::new("Bob"),
31 Cell::new("Support"),
32 Cell::new("Away"),
33 ]);
34
35 println!("{}", table);
36}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