Struct umya_spreadsheet::structs::Spreadsheet

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

A Spreadsheet Object. The starting point of all struct.

Implementations§

source§

impl Spreadsheet

source

pub fn insert_new_row( &mut self, sheet_name: &str, row_index: &u32, num_rows: &u32 )

Insert new rows.

§Arguments
  • sheet_name - Specify the sheet name. ex) “Sheet1”
  • row_index - Specify point of insert. ex) 1
  • num_rows - Specify number to insert. ex) 2
§Examples
let mut book = umya_spreadsheet::new_file();
book.insert_new_row("Sheet1", &2, &3);
source

pub fn insert_new_column( &mut self, sheet_name: &str, column: &str, num_columns: &u32 )

Insert new columns.

§Arguments
  • sheet_name - Specify the sheet name. ex) “Sheet1”
  • column - Specify point of insert. ex) “B”
  • num_columns - Specify number to insert. ex) 3
§Examples
let mut book = umya_spreadsheet::new_file();
book.insert_new_column("Sheet1", "B", &3);
source

pub fn insert_new_column_by_index( &mut self, sheet_name: &str, column_index: &u32, num_columns: &u32 )

Insert new columns.

§Arguments
  • sheet_name - Specify the sheet name. ex) “Sheet1”
  • column_index - Specify point of insert. ex) 2
  • num_columns - Specify number to insert. ex) 3
§Examples
let mut book = umya_spreadsheet::new_file();
book.insert_new_column_by_index("Sheet1", &2, &3);
source

pub fn remove_row(&mut self, sheet_name: &str, row_index: &u32, num_rows: &u32)

Remove rows.

§Arguments
  • sheet_name - Specify the sheet name. ex) “Sheet1”
  • row_index - Specify point of remove. ex) &1
  • num_rows - Specify number to remove. ex) &2
§Examples
let mut book = umya_spreadsheet::new_file();
book.remove_row("Sheet1", &2, &3);
source

pub fn remove_column( &mut self, sheet_name: &str, column: &str, num_columns: &u32 )

Remove columns.

§Arguments
  • sheet_name - Specify the sheet name. ex) “Sheet1”
  • column - Specify point of remove. ex) “B”
  • num_columns - Specify number to remove. ex) 3
§Examples
let mut book = umya_spreadsheet::new_file();
book.remove_column("Sheet1", "B", &3);
source

pub fn remove_column_by_index( &mut self, sheet_name: &str, column_index: &u32, num_columns: &u32 )

Remove columns.

§Arguments
  • sheet_name - Specify the sheet name. ex) “Sheet1”
  • column_index - Specify point of remove. ex) 2
  • num_columns - Specify number to remove. ex) 3
§Examples
let mut book = umya_spreadsheet::new_file();
book.remove_column_by_index("Sheet1", &2, &3);
source

pub fn get_cell_value_by_address(&self, address: &str) -> Vec<&CellValue>

Gets the cell value by specifying an address.

§Arguments
  • address - address. ex) “Sheet1!A1:C5”
§Return value

*Vec<&CellValue> - CellValue List.

§Examples
let mut book = umya_spreadsheet::new_file();
let mut cell_value_List = book.get_cell_value_by_address("Sheet1!A1:C5");
source

pub fn get_theme(&self) -> &Theme

Get Theme.

source

pub fn get_theme_mut(&mut self) -> &mut Theme

Get Theme in mutable.

source

pub fn set_theme(&mut self, value: Theme) -> &mut Self

Set Theme.

§Arguments
  • value - Theme
source

pub fn get_properties(&self) -> &Properties

Get Properties.

source

pub fn get_properties_mut(&mut self) -> &mut Properties

Get Properties in mutable.

source

pub fn set_properties(&mut self, value: Properties) -> &mut Self

Set Properties.

§Arguments
  • value - Properties
source

pub fn get_macros_code(&self) -> Option<&Vec<u8>>

Get Macros Code.

§Return value
  • Option<&Vec<u8>> - Macros Code Raw Data.
source

pub fn set_macros_code(&mut self, value: Vec<u8>) -> &mut Self

Set Macros Code.

§Arguments
  • value - Macros Code Raw Data.
source

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

Remove Macros Code

source

pub fn get_has_macros(&self) -> bool

Has Macros Code

source

pub fn set_code_name<S: ToString>(&mut self, codename: S) -> &mut Self

Set codeName property of workbook

May be useful when importing VBA/macros code from another workbook and only used when writing book with macros code

Default one is ThisWorkbook.

Excel often uses Workbook________ (8 underscores).

source

pub fn get_code_name(&self) -> Option<&str>

Get codeName property of workbook

Must to be the same in workbook with VBA/macros code from this workbook for that code in Workbook object to work out of the box without adjustments

source

pub fn get_sheet_collection(&self) -> &Vec<Worksheet>

Get Work Sheet List.

source

pub fn get_sheet_collection_no_check(&self) -> &Vec<Worksheet>

Get Work Sheet List. No check deserialized.

source

pub fn get_sheet_collection_mut(&mut self) -> &mut Vec<Worksheet>

Get Work Sheet List in mutable.

source

pub fn get_sheet_count(&self) -> usize

Get Work Sheet Count.

§Return value
  • usize - Work Sheet Count.
source

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

deserialize by all worksheet.

source

pub fn read_sheet(&mut self, index: usize) -> &mut Self

deserialize a worksheet.

source

pub fn get_sheet(&self, index: &usize) -> Option<&Worksheet>

Get Work Sheet.

§Arguments
  • index - sheet index
§Return value
  • Option<&Worksheet>.
source

pub fn get_sheet_by_name(&self, sheet_name: &str) -> Option<&Worksheet>

Get Work Sheet.

§Arguments
  • sheet_name - sheet name
§Return value
  • `Option<&Worksheet>.
source

pub fn get_lazy_read_sheet_cells( &self, index: &usize ) -> Result<Cells, &'static str>

source

pub fn get_sheet_mut(&mut self, index: &usize) -> Option<&mut Worksheet>

Get Work Sheet in mutable.

§Arguments
  • index - sheet index
§Return value
  • Option<&mut Worksheet>.
source

pub fn get_sheet_by_name_mut( &mut self, sheet_name: &str ) -> Option<&mut Worksheet>

Get Work Sheet in mutable.

§Arguments
  • sheet_name - sheet name
§Return value
  • Option<&mut Worksheet>.
source

pub fn set_active_sheet(&mut self, index: u32) -> &mut Self

source

pub fn get_active_sheet(&self) -> &Worksheet

Get Active Work Sheet.

§Return value
  • &Worksheet - Work sheet.
source

pub fn get_active_sheet_mut(&mut self) -> &mut Worksheet

Get Active Work Sheet in mutable.

§Return value
  • &mut Worksheet - Work sheet.
source

pub fn add_sheet( &mut self, value: Worksheet ) -> Result<&mut Worksheet, &'static str>

Add Work Sheet.

§Arguments
  • value - Work Sheet
§Return value
  • Result<&mut Worksheet, &'static str> - OK:added work sheet. Err:Error.
source

pub fn remove_sheet(&mut self, index: usize) -> Result<(), &'static str>

Remove Work Sheet.

§Arguments
  • index - sheet index
§Return value
  • Result<(), &'static str> - OK:removed worksheet. Err:Error.
source

pub fn remove_sheet_by_name( &mut self, sheet_name: &str ) -> Result<(), &'static str>

Remove Work Sheet.

§Arguments
  • sheet_name - sheet name
§Return value
  • Result<(), &'static str> - OK:removed worksheet. Err:Error.
source

pub fn new_sheet<S: Into<String>>( &mut self, sheet_title: S ) -> Result<&mut Worksheet, &'static str>

Add New Work Sheet.

§Arguments
  • sheet_title - sheet title
§Return value
  • Result<&mut Worksheet, &'static str> - OK:added work sheet. Err:Error.
source

pub fn set_sheet_name<S: Into<String>>( &mut self, index: usize, sheet_name: S ) -> Result<(), &'static str>

Set Sheet Name.

§Arguments
  • index - target sheet index
  • sheet_name - sheet name
§Return value
  • Result<(), &'static str> - OK:Success Err:Error.
source

pub fn get_workbook_view(&self) -> &WorkbookView

Get Workbook View.

source

pub fn get_workbook_view_mut(&mut self) -> &mut WorkbookView

Get Workbook View in mutable.

source

pub fn set_workbook_view(&mut self, value: WorkbookView) -> &mut Self

Set Workbook View.

§Arguments
  • value - WorkbookView
source

pub fn get_workbook_protection(&self) -> Option<&WorkbookProtection>

source

pub fn get_workbook_protection_mut(&mut self) -> &mut WorkbookProtection

source

pub fn set_workbook_protection( &mut self, value: WorkbookProtection ) -> &mut Self

source

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

source

pub fn get_defined_names(&self) -> &Vec<DefinedName>

Get Defined Name (Vec).

source

pub fn get_defined_names_mut(&mut self) -> &mut Vec<DefinedName>

Get Defined Name (Vec) in mutable.

source

pub fn set_defined_names(&mut self, value: Vec<DefinedName>)

Set Defined Name (Vec).

§Arguments
  • value - Vec.
source

pub fn add_defined_names(&mut self, value: DefinedName)

Add Defined Name.

§Arguments
  • value - DefinedName.

Trait Implementations§

source§

impl Clone for Spreadsheet

source§

fn clone(&self) -> Spreadsheet

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 Spreadsheet

source§

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

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

impl Default for Spreadsheet

source§

fn default() -> Spreadsheet

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

Auto Trait Implementations§

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.