Trait calamine::Reader [−][src]
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 FileType
s
Associated Types
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>>
&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>>
&mut self,
_: &str
) -> Option<Result<Range<String>, Self::Error>>
Read worksheet formula in corresponding worksheet path
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)
Implementors
impl Reader for Sheets type RS = BufReader<File>; type Error = Error;
impl<RS: Read + Seek> Reader for Ods<RS> type RS = RS; type Error = OdsError;
impl<RS: Read + Seek> Reader for Xls<RS> type Error = XlsError; type RS = RS;
impl<RS: Read + Seek> Reader for Xlsb<RS> type RS = RS; type Error = XlsbError;
impl<RS: Read + Seek> Reader for Xlsx<RS> type RS = RS; type Error = XlsxError;