Struct umya_spreadsheet::structs::Style
source · 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 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
Trait Implementations§
source§impl PartialEq<Style> for Style
impl PartialEq<Style> for Style
source§impl PartialOrd<Style> for Style
impl PartialOrd<Style> for Style
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl StructuralPartialEq for Style
Auto Trait Implementations§
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
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.