Struct umya_spreadsheet::structs::Style

source ·
pub struct Style { /* private fields */ }
Expand description

§Examples

§add border

Result Image

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

Result Image

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

Result Image

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

source

pub fn get_font(&self) -> Option<&Font>

source

pub fn get_font_mut(&mut self) -> &mut Font

source

pub fn set_font(&mut self, value: Font) -> &mut Self

source

pub fn remove_font(&mut self) -> &mut Self

source

pub fn get_fill(&self) -> Option<&Fill>

source

pub fn get_fill_mut(&mut self) -> &mut Fill

source

pub fn set_fill(&mut self, value: Fill) -> &mut Self

source

pub fn get_background_color(&self) -> Option<&Color>

source

pub fn set_background_color<S: Into<String>>(&mut self, color: S) -> &mut Self

source

pub fn set_background_color_solid<S: Into<String>>( &mut self, color: S ) -> &mut Self

source

pub fn set_background_color_with_pattern<S: Into<String>>( &mut self, color1: S, color2: S, pattern: PatternValues ) -> &mut Self

source

pub fn remove_fill(&mut self) -> &mut Self

source

pub fn get_borders(&self) -> Option<&Borders>

source

pub fn get_borders_mut(&mut self) -> &mut Borders

source

pub fn set_borders(&mut self, value: Borders) -> &mut Self

source

pub fn remove_borders(&mut self) -> &mut Self

source

pub fn get_alignment(&self) -> Option<&Alignment>

source

pub fn get_alignment_mut(&mut self) -> &mut Alignment

source

pub fn set_alignment(&mut self, value: Alignment) -> &mut Self

source

pub fn remove_alignment(&mut self) -> &mut Self

source

pub fn get_numbering_format(&self) -> Option<&NumberingFormat>

source

pub fn get_numbering_format_mut(&mut self) -> &mut NumberingFormat

source

pub fn set_numbering_format(&mut self, value: NumberingFormat) -> &mut Self

source

pub fn remove_numbering_format(&mut self) -> &mut Self

source

pub fn get_number_format(&self) -> Option<&NumberingFormat>

source

pub fn get_number_format_mut(&mut self) -> &mut NumberingFormat

source

pub fn set_number_format(&mut self, value: NumberingFormat) -> &mut Self

source

pub fn remove_number_format(&mut self) -> &mut Self

source

pub fn get_format_id(&self) -> &u32

source

pub fn set_format_id(&mut self, value: u32) -> &mut Self

source

pub fn get_protection(&self) -> Option<&Protection>

source

pub fn get_protection_mut(&mut self) -> &mut Protection

source

pub fn set_protection(&mut self, value: Protection) -> &mut Self

source

pub fn remove_protection(&mut self) -> &mut Self

Trait Implementations§

source§

impl Clone for Style

source§

fn clone(&self) -> Style

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Style

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Style

source§

fn default() -> Style

Returns the “default value” for a type. Read more
source§

impl PartialEq for Style

source§

fn eq(&self, other: &Style) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Style

source§

fn partial_cmp(&self, other: &Style) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

source§

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().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.