pub fn new_with_options(mut reader: RS, options: XlsOptions) -> Result<Self, XlsError>
    where
        RS: Read + Seek,
    {
        let mut cfb = {
            let offset_end = reader.seek(SeekFrom::End(0))? as usize;
            reader.seek(SeekFrom::Start(0))?;
            Cfb::new(&mut reader, offset_end)?
        };

        debug!("cfb loaded");

        // Reads vba once for all (better than reading all worksheets once for all)
        let vba = if cfb.has_directory("_VBA_PROJECT_CUR") {
            Some(VbaProject::from_cfb(&mut reader, &mut cfb)?)
        } else {
            None
        };

        debug!("vba ok");

        let mut xls = Xls {
            sheets: HashMap::new(),
            vba,
            marker: PhantomData,
            metadata: Metadata::default(),
            options,
        };

        xls.parse_workbook(reader, cfb)?;

        debug!("xls parsed");

        Ok(xls)
    }
/// Creates a new instance using `Options` to inform parsing.
///
/// ```
/// use calamine::{Xls,XlsOptions};
/// # use std::io::Cursor;
/// # const BYTES: &'static [u8] = b"";
///
/// # fn run() -> Result<Xls<Cursor<&'static [u8]>>, calamine::XlsError> {
/// # let reader = std::io::Cursor::new(BYTES);
/// let mut options = XlsOptions::default();
/// // ...set options...
/// let workbook = Xls::new_with_options(reader, options)?;
/// # Ok(workbook) }
/// # fn main() { assert!(run().is_err()); }
/// ```
Creates a new instance using `Options` to inform parsing.
Creates a new instance using ` Options ` to inform parsing .
pub fn new_with_options(mut reader: RS, options: XlsOptions) -> Result<Self, XlsError>
    where
        RS: Read + Seek,
    {
        let mut cfb = {
            let offset_end = reader.seek(SeekFrom::End(0))? as usize;
            reader.seek(SeekFrom::Start(0))?;
            Cfb::new(&mut reader, offset_end)?
        };
        debug!("cfb loaded");
        // Reads vba once for all (better than reading all worksheets once for all)
        let vba = if cfb.has_directory("_VBA_PROJECT_CUR") {
            Some(VbaProject::from_cfb(&mut reader, &mut cfb)?)
        } else {
            None
        };
        debug!("vba ok");
        let mut xls = Xls {
            sheets: HashMap::new(),
            vba,
            marker: PhantomData,
            metadata: Metadata::default(),
            options,
        };
        xls.parse_workbook(reader, cfb)?;
        debug!("xls parsed");
        Ok(xls)
    }
pub fn new_with_options ( mut reader : RS , options : XlsOptions ) -> Result < Self , XlsError > where RS : Read + Seek , { let mut cfb = { let offset_end = reader . seek ( SeekFrom :: End ( 0 ) ) ? as usize ; reader . seek ( SeekFrom :: Start ( 0 ) ) ? ; Cfb :: new ( & mut reader , offset_end ) ? } ; debug ! ( " " ) ; // Reads vba once for all (better than reading all worksheets once for all) let vba = if cfb . has_directory ( " " ) { Some ( VbaProject :: from_cfb ( & mut reader , & mut cfb ) ? ) } else { None } ; debug ! ( " " ) ; let mut xls = Xls { sheets : HashMap :: new ( ) , vba , marker : PhantomData , metadata : Metadata :: default ( ) , options , } ; xls . parse_workbook ( reader , cfb ) ? ; debug ! ( " " ) ; Ok ( xls ) }
Creates a new instance using `Options` to inform parsing.
Creates a new instance using ` Options ` to inform parsing .
reader
RS
options
XlsOptions
use std::io::cursor;
None
const bytes: &'static [u8] = b"";
None
fn run() -> result<xls<cursor<&'static [u8]>>, calamine::xlserror> {
None
let reader = std::io::cursor::new(bytes);
let mut options = XlsOptions::default();
set options
let workbook = Xls::new_with_options(reader, options)?.
let mut options = XlsOptions :: default () ; set options let workbook = Xls :: new_with_options ( reader options ) ? .
ok(workbook) }
None
fn main() { assert!(run().is_err()); }
None