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 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
Trait Implementations§
source§impl PartialEq for Style
impl PartialEq for Style
source§impl PartialOrd for Style
impl PartialOrd 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 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
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>
Converts
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>
Converts
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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.