pub struct Worksheet {
    pub name: String,
    pub position: u8,
    /* private fields */
}
Expand description

The Worksheet is the primary object in this module since this is where most of the valuable data is. See the methods below for how to use.

Fields

name: Stringposition: u8

Implementations

Create a new worksheet. Note that this method will probably not be called directly. Instead, you’ll normally get a worksheet from a Workbook object. E.g.,:

use xl::{Workbook, Worksheet};

let mut wb = Workbook::open("tests/data/Book1.xlsx").unwrap();
let sheets = wb.sheets();
let ws = sheets.get("Time");
assert!(ws.is_some());

Obtain a RowIter for this worksheet (that is in workbook). This is, arguably, the main part of the library. You use this method to iterate through all the values in this sheet. The simplest thing you can do is print the values out (which is what xlcat does), but you could do more if you wanted.

Example usage
use xl::{Workbook, Worksheet, ExcelValue};

let mut wb = Workbook::open("tests/data/Book1.xlsx").unwrap();
let sheets = wb.sheets();
let ws = sheets.get("Sheet1").unwrap();
let mut rows = ws.rows(&mut wb);
let row1 = rows.next().unwrap();
assert_eq!(row1[0].raw_value, "1");
assert_eq!(row1[1].value, ExcelValue::Number(2f64));

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.