[][src]Trait calamine::Reader

pub trait Reader: Sized {
    type RS: Read + Seek;
    type Error: Debug + From<Error>;
    fn new(reader: Self::RS) -> Result<Self, Self::Error>;
fn vba_project(&mut self) -> Option<Result<Cow<VbaProject>, Self::Error>>;
fn metadata(&self) -> &Metadata;
fn worksheet_range(
        &mut self,
        name: &str
    ) -> Option<Result<Range<DataType>, Self::Error>>;
fn worksheet_formula(
        &mut self,
        _: &str
    ) -> Option<Result<Range<String>, Self::Error>>; fn sheet_names(&self) -> &[String] { ... }
fn defined_names(&self) -> &[(String, String)] { ... } }

A trait to share spreadsheets reader functions accross different FileTypes

Associated Types

type RS: Read + Seek

Inner reader type

type Error: Debug + From<Error>

Error specific to file type

Loading content...

Required methods

fn new(reader: Self::RS) -> Result<Self, Self::Error>

Creates a new instance.

fn vba_project(&mut self) -> Option<Result<Cow<VbaProject>, Self::Error>>

Gets VbaProject

fn metadata(&self) -> &Metadata

Initialize

fn worksheet_range(
    &mut self,
    name: &str
) -> Option<Result<Range<DataType>, Self::Error>>

Read worksheet data in corresponding worksheet path

fn worksheet_formula(
    &mut self,
    _: &str
) -> Option<Result<Range<String>, Self::Error>>

Read worksheet formula in corresponding worksheet path

Loading content...

Provided methods

fn sheet_names(&self) -> &[String]

Get all sheet names of this workbook

Examples

use calamine::{Xlsx, open_workbook, Reader};

let mut workbook: Xlsx<_> = open_workbook(path).unwrap();
println!("Sheets: {:#?}", workbook.sheet_names());

fn defined_names(&self) -> &[(String, String)]

Get all defined names (Ranges names etc)

Loading content...

Implementors

impl Reader for Sheets[src]

type RS = BufReader<File>

type Error = Error

fn new(_reader: Self::RS) -> Result<Self, Self::Error>[src]

Creates a new instance.

fn vba_project(&mut self) -> Option<Result<Cow<VbaProject>, Self::Error>>[src]

Gets VbaProject

fn metadata(&self) -> &Metadata[src]

Initialize

fn worksheet_range(
    &mut self,
    name: &str
) -> Option<Result<Range<DataType>, Self::Error>>
[src]

Read worksheet data in corresponding worksheet path

fn worksheet_formula(
    &mut self,
    name: &str
) -> Option<Result<Range<String>, Self::Error>>
[src]

Read worksheet formula in corresponding worksheet path

impl<RS: Read + Seek> Reader for Ods<RS>[src]

type RS = RS

type Error = OdsError

fn vba_project(&mut self) -> Option<Result<Cow<VbaProject>, OdsError>>[src]

Gets VbaProject

fn metadata(&self) -> &Metadata[src]

Read sheets from workbook.xml and get their corresponding path from relationships

fn worksheet_range(
    &mut self,
    name: &str
) -> Option<Result<Range<DataType>, OdsError>>
[src]

Read worksheet data in corresponding worksheet path

fn worksheet_formula(
    &mut self,
    name: &str
) -> Option<Result<Range<String>, OdsError>>
[src]

Read worksheet data in corresponding worksheet path

impl<RS: Read + Seek> Reader for Xls<RS>[src]

type Error = XlsError

type RS = RS

fn metadata(&self) -> &Metadata[src]

Parses Workbook stream, no need for the relationships variable

impl<RS: Read + Seek> Reader for Xlsb<RS>[src]

type RS = RS

type Error = XlsbError

fn worksheet_range(
    &mut self,
    name: &str
) -> Option<Result<Range<DataType>, XlsbError>>
[src]

MS-XLSB 2.1.7.62

fn worksheet_formula(
    &mut self,
    name: &str
) -> Option<Result<Range<String>, XlsbError>>
[src]

MS-XLSB 2.1.7.62

impl<RS: Read + Seek> Reader for Xlsx<RS>[src]

type RS = RS

type Error = XlsxError

Loading content...