pub struct HeaderBuilder {
pub levels: Vec<Vec<HeaderCell>>,
pub total_columns: usize,
pub default_style: CellStyle,
}Expand description
Builder for creating complex multi-level table headers
Fields§
§levels: Vec<Vec<HeaderCell>>All header cells organized by levels
total_columns: usizeTotal number of columns in the table
default_style: CellStyleDefault style for headers
Implementations§
Source§impl HeaderBuilder
impl HeaderBuilder
Sourcepub fn auto() -> Self
pub fn auto() -> Self
Create a new header builder without specifying columns (for compatibility with tests)
Sourcepub fn add_level(self, headers: Vec<(&str, usize)>) -> Self
pub fn add_level(self, headers: Vec<(&str, usize)>) -> Self
Add a header level with (text, colspan) pairs
Sourcepub fn default_style(self, style: CellStyle) -> Self
pub fn default_style(self, style: CellStyle) -> Self
Set default header style
Sourcepub fn add_simple_row(self, headers: Vec<&str>) -> Self
pub fn add_simple_row(self, headers: Vec<&str>) -> Self
Add a simple single-level header row
Sourcepub fn add_custom_row(self, cells: Vec<HeaderCell>) -> Self
pub fn add_custom_row(self, cells: Vec<HeaderCell>) -> Self
Add a header row with custom cells
Sourcepub fn add_group(self, group_header: &str, sub_headers: Vec<&str>) -> Self
pub fn add_group(self, group_header: &str, sub_headers: Vec<&str>) -> Self
Add a grouped header (spans multiple columns) with sub-headers
Example: “Sales Data” spanning 3 columns with sub-headers “Q1”, “Q2”, “Q3”
Sourcepub fn add_complex_header(
self,
text: &str,
start_col: usize,
colspan: usize,
rowspan: usize,
) -> Self
pub fn add_complex_header( self, text: &str, start_col: usize, colspan: usize, rowspan: usize, ) -> Self
Add a complex header structure with manual positioning
Sourcepub fn calculate_height(&self) -> f64
pub fn calculate_height(&self) -> f64
Get the height needed for headers (in points, assuming default font size)
Sourcepub fn validate(&self) -> Result<(), TableError>
pub fn validate(&self) -> Result<(), TableError>
Validate the header structure
Sourcepub fn get_cells_at_position(
&self,
level: usize,
col: usize,
) -> Vec<&HeaderCell>
pub fn get_cells_at_position( &self, level: usize, col: usize, ) -> Vec<&HeaderCell>
Get all cells that should be rendered at a specific position
Sourcepub fn financial_report() -> Self
pub fn financial_report() -> Self
Create a financial report header
Sourcepub fn product_comparison(products: Vec<&str>) -> Self
pub fn product_comparison(products: Vec<&str>) -> Self
Create a product comparison header
Trait Implementations§
Source§impl Clone for HeaderBuilder
impl Clone for HeaderBuilder
Source§fn clone(&self) -> HeaderBuilder
fn clone(&self) -> HeaderBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HeaderBuilder
impl Debug for HeaderBuilder
Auto Trait Implementations§
impl Freeze for HeaderBuilder
impl RefUnwindSafe for HeaderBuilder
impl Send for HeaderBuilder
impl Sync for HeaderBuilder
impl Unpin for HeaderBuilder
impl UnwindSafe for HeaderBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().