pub struct Workbook { /* private fields */ }
Implementations§
Source§impl Workbook
impl Workbook
Sourcepub fn add_sheet<S: Into<Cow<'static, str>>>(
&mut self,
sheet_name: Option<S>,
) -> &mut Sheet
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§
Auto Trait Implementations§
impl Freeze for Workbook
impl RefUnwindSafe for Workbook
impl Send for Workbook
impl Sync for Workbook
impl Unpin for Workbook
impl UnwindSafe for Workbook
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