pub struct Style { /* private fields */ }
Expand description
§Examples
§add border
use umya_spreadsheet::*;
let mut book = new_file();
let mut style = book.get_sheet_by_name_mut("Sheet1").unwrap().get_style_mut("D2");
// add bottom border
style.get_borders_mut().get_bottom_mut().set_border_style(Border::BORDER_MEDIUM);
// add top border
style.get_borders_mut().get_top_mut().set_border_style(Border::BORDER_MEDIUM);
// add left border
style.get_borders_mut().get_left_mut().set_border_style(Border::BORDER_MEDIUM);
// add right border
style.get_borders_mut().get_right_mut().set_border_style(Border::BORDER_MEDIUM);
§change cell color
use umya_spreadsheet::*;
let mut book = new_file();
let mut style = book.get_sheet_by_name_mut("Sheet1").unwrap().get_style_mut("A1");
// fill color on red.
style.set_background_color(Color::COLOR_RED);
§change font color
use umya_spreadsheet::*;
let mut book = new_file();
let mut style = book.get_sheet_by_name_mut("Sheet1").unwrap().get_style_mut("A1");
// font color on red.
style.get_font_mut().get_color_mut().set_argb(Color::COLOR_RED);
Implementations§
Source§impl Style
impl Style
pub fn get_font(&self) -> Option<&Font>
pub fn get_font_mut(&mut self) -> &mut Font
pub fn set_font(&mut self, value: Font) -> &mut Self
pub fn remove_font(&mut self) -> &mut Self
pub fn get_fill(&self) -> Option<&Fill>
pub fn get_fill_mut(&mut self) -> &mut Fill
pub fn set_fill(&mut self, value: Fill) -> &mut Self
pub fn get_background_color(&self) -> Option<&Color>
pub fn set_background_color<S: Into<String>>(&mut self, color: S) -> &mut Self
pub fn set_background_color_solid<S: Into<String>>( &mut self, color: S, ) -> &mut Self
pub fn set_background_color_with_pattern<S: Into<String>>( &mut self, color1: S, color2: S, pattern: PatternValues, ) -> &mut Self
pub fn remove_fill(&mut self) -> &mut Self
pub fn get_borders(&self) -> Option<&Borders>
pub fn get_borders_mut(&mut self) -> &mut Borders
pub fn set_borders(&mut self, value: Borders) -> &mut Self
pub fn remove_borders(&mut self) -> &mut Self
pub fn get_alignment(&self) -> Option<&Alignment>
pub fn get_alignment_mut(&mut self) -> &mut Alignment
pub fn set_alignment(&mut self, value: Alignment) -> &mut Self
pub fn remove_alignment(&mut self) -> &mut Self
pub fn get_numbering_format(&self) -> Option<&NumberingFormat>
pub fn get_numbering_format_mut(&mut self) -> &mut NumberingFormat
pub fn set_numbering_format(&mut self, value: NumberingFormat) -> &mut Self
pub fn remove_numbering_format(&mut self) -> &mut Self
pub fn get_number_format(&self) -> Option<&NumberingFormat>
pub fn get_number_format_mut(&mut self) -> &mut NumberingFormat
pub fn set_number_format(&mut self, value: NumberingFormat) -> &mut Self
pub fn remove_number_format(&mut self) -> &mut Self
pub fn get_format_id(&self) -> &u32
pub fn set_format_id(&mut self, value: u32) -> &mut Self
pub fn get_protection(&self) -> Option<&Protection>
pub fn get_protection_mut(&mut self) -> &mut Protection
pub fn set_protection(&mut self, value: Protection) -> &mut Self
pub fn remove_protection(&mut self) -> &mut Self
pub fn get_default_value() -> Self
Trait Implementations§
Source§impl PartialOrd for Style
impl PartialOrd for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnwindSafe for Style
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