pub struct TableBuilder { /* private fields */ }Expand description
表格构建器(纯文字单元格)。
Implementations§
Source§impl TableBuilder
impl TableBuilder
Sourcepub fn head_rich<R>(
&mut self,
f: impl FnOnce(&mut RowBuilder) -> R,
) -> &mut Self
pub fn head_rich<R>( &mut self, f: impl FnOnce(&mut RowBuilder) -> R, ) -> &mut Self
设表头(富文本:每格一个闭包拼行内)。
Sourcepub fn row_rich<R>(&mut self, f: impl FnOnce(&mut RowBuilder) -> R) -> &mut Self
pub fn row_rich<R>(&mut self, f: impl FnOnce(&mut RowBuilder) -> R) -> &mut Self
加一数据行(富文本:每格一个闭包拼行内)。
Sourcepub fn align<I: IntoIterator<Item = Align>>(&mut self, aligns: I) -> &mut Self
pub fn align<I: IntoIterator<Item = Align>>(&mut self, aligns: I) -> &mut Self
设各列对齐(从第 0 列起)。
Sourcepub fn col_style<R>(
&mut self,
col: usize,
f: impl Fn(&mut StyleBuilder) -> R,
) -> &mut Self
pub fn col_style<R>( &mut self, col: usize, f: impl Fn(&mut StyleBuilder) -> R, ) -> &mut Self
整列(含表头)的文字样式。
Sourcepub fn row_style<R>(
&mut self,
row: usize,
f: impl Fn(&mut StyleBuilder) -> R,
) -> &mut Self
pub fn row_style<R>( &mut self, row: usize, f: impl Fn(&mut StyleBuilder) -> R, ) -> &mut Self
整行(数据行,0 起)的文字样式。
Sourcepub fn cell_style<R>(
&mut self,
row: usize,
col: usize,
f: impl Fn(&mut StyleBuilder) -> R,
) -> &mut Self
pub fn cell_style<R>( &mut self, row: usize, col: usize, f: impl Fn(&mut StyleBuilder) -> R, ) -> &mut Self
单格(数据行 / 列,0 起)的文字样式。
Sourcepub fn cell_fill(&mut self, row: usize, col: usize, hex: &str) -> &mut Self
pub fn cell_fill(&mut self, row: usize, col: usize, hex: &str) -> &mut Self
单格(数据行 / 列)背景填色(非法色忽略,不动已设值)。
Sourcepub fn table_align(&mut self, a: Align) -> &mut Self
pub fn table_align(&mut self, a: Align) -> &mut Self
整表水平对齐(窄表生效;别与 expand 混用——铺满了没得对齐)。
Sourcepub fn grid_outer(&mut self, on: bool) -> &mut Self
pub fn grid_outer(&mut self, on: bool) -> &mut Self
外框线开关。
Sourcepub fn grid_vertical(&mut self, on: bool) -> &mut Self
pub fn grid_vertical(&mut self, on: bool) -> &mut Self
列竖线开关。
Sourcepub fn grid_horizontal(&mut self, on: bool) -> &mut Self
pub fn grid_horizontal(&mut self, on: bool) -> &mut Self
行横线开关。
Sourcepub fn header_fill(&mut self, on: bool) -> &mut Self
pub fn header_fill(&mut self, on: bool) -> &mut Self
表头浅底开关。
Auto Trait Implementations§
impl Freeze for TableBuilder
impl RefUnwindSafe for TableBuilder
impl Send for TableBuilder
impl Sync for TableBuilder
impl Unpin for TableBuilder
impl UnsafeUnpin for TableBuilder
impl UnwindSafe for TableBuilder
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