Struct Workbook

Source
pub struct Workbook { /* private fields */ }

Implementations§

Source§

impl Workbook

Source

pub fn add_sheet<S: Into<Cow<'static, str>>>( &mut self, sheet_name: Option<S>, ) -> &mut Sheet

Examples found in repository?
examples/demo.rs (line 9)
5fn main() -> Result<()> {
6    let mut excel = Excel::default();
7    let mut context = Context::default();
8
9    let sheet = excel.workbook().add_sheet(Some("hello"));
10
11    {
12        let row = sheet.add_row();
13
14        row.add_str_cell(&mut context, "cell1");
15        row.add_str_cell(&mut context, "cell2");
16    }
17
18    {
19        let row = sheet.get_row(RowIndex(1));
20        row.set_str_cell(&mut context, ColIndex(0), "hello");
21    }
22
23    sheet.set_merge_cell(MergeCell {
24        from_row_index: RowIndex(1),
25        from_col_index: ColIndex(0),
26        to_row_index: RowIndex(1),
27        to_col_index: None,
28    });
29
30    excel.write_to_file(&context, "demo.xlsx")?;
31
32    Ok(())
33}

Trait Implementations§

Source§

impl Default for Workbook

Source§

fn default() -> Workbook

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V