pub struct StyleBuilder { /* private fields */ }Expand description
Builder for creating Style objects with a fluent API.
Each setter method initializes the relevant sub-struct if it has not been
set yet, then applies the value. Call build() to obtain the final Style.
Implementations§
Source§impl StyleBuilder
impl StyleBuilder
Sourcepub fn strikethrough(self, strikethrough: bool) -> Self
pub fn strikethrough(self, strikethrough: bool) -> Self
Set the strikethrough flag on the font.
Sourcepub fn font_color(self, color: StyleColor) -> Self
pub fn font_color(self, color: StyleColor) -> Self
Set the font color using a StyleColor value.
Sourcepub fn font_color_rgb(self, rgb: &str) -> Self
pub fn font_color_rgb(self, rgb: &str) -> Self
Set the font color using an ARGB hex string (e.g. “FF0000FF”).
Sourcepub fn fill_pattern(self, pattern: PatternType) -> Self
pub fn fill_pattern(self, pattern: PatternType) -> Self
Set the fill pattern type.
Sourcepub fn fill_fg_color(self, color: StyleColor) -> Self
pub fn fill_fg_color(self, color: StyleColor) -> Self
Set the fill foreground color.
Sourcepub fn fill_fg_color_rgb(self, rgb: &str) -> Self
pub fn fill_fg_color_rgb(self, rgb: &str) -> Self
Set the fill foreground color using an ARGB hex string.
Sourcepub fn fill_bg_color(self, color: StyleColor) -> Self
pub fn fill_bg_color(self, color: StyleColor) -> Self
Set the fill background color.
Sourcepub fn solid_fill(self, rgb: &str) -> Self
pub fn solid_fill(self, rgb: &str) -> Self
Convenience method: set a solid fill with the given ARGB foreground color.
Sourcepub fn border_left(self, style: BorderLineStyle, color: StyleColor) -> Self
pub fn border_left(self, style: BorderLineStyle, color: StyleColor) -> Self
Set the left border style and color.
Sourcepub fn border_right(self, style: BorderLineStyle, color: StyleColor) -> Self
pub fn border_right(self, style: BorderLineStyle, color: StyleColor) -> Self
Set the right border style and color.
Sourcepub fn border_top(self, style: BorderLineStyle, color: StyleColor) -> Self
pub fn border_top(self, style: BorderLineStyle, color: StyleColor) -> Self
Set the top border style and color.
Sourcepub fn border_bottom(self, style: BorderLineStyle, color: StyleColor) -> Self
pub fn border_bottom(self, style: BorderLineStyle, color: StyleColor) -> Self
Set the bottom border style and color.
Sourcepub fn border_all(self, style: BorderLineStyle, color: StyleColor) -> Self
pub fn border_all(self, style: BorderLineStyle, color: StyleColor) -> Self
Set all four border sides (left, right, top, bottom) to the same style and color.
Sourcepub fn horizontal_align(self, align: HorizontalAlign) -> Self
pub fn horizontal_align(self, align: HorizontalAlign) -> Self
Set horizontal alignment.
Sourcepub fn vertical_align(self, align: VerticalAlign) -> Self
pub fn vertical_align(self, align: VerticalAlign) -> Self
Set vertical alignment.
Sourcepub fn text_rotation(self, degrees: u32) -> Self
pub fn text_rotation(self, degrees: u32) -> Self
Set text rotation in degrees.
Sourcepub fn shrink_to_fit(self, shrink: bool) -> Self
pub fn shrink_to_fit(self, shrink: bool) -> Self
Set the shrink to fit flag.
Sourcepub fn num_format_builtin(self, id: u32) -> Self
pub fn num_format_builtin(self, id: u32) -> Self
Set a built-in number format by ID (see builtin_num_fmts constants).
Sourcepub fn num_format_custom(self, format: &str) -> Self
pub fn num_format_custom(self, format: &str) -> Self
Set a custom number format string (e.g. “#,##0.00”).
Set the hidden flag for cell protection.