Struct Reader

Source
pub struct Reader<'ole> { /* private fields */ }
Expand description

An OLE file reader.

The parsing method follows the same method described here: http://www.openoffice.org/sc/compdocfileformat.pdf

§Basic Example

use ole::Reader;

let mut reader =
      Reader::from_path("assets/Thumbs.db").unwrap();

println!("This OLE file stores the following entries: ");
for entry in reader.iterate() {
  println!("{}", entry);
}

Implementations§

Source§

impl<'ole> Reader<'ole>

Source

pub fn new<T>(readable: T) -> Result<Reader<'ole>, Error>
where T: Read + 'ole,

Constructs a new Reader.

§Examples
use ole;
let mut my_resume = std::fs::File::open("assets/Thumbs.db").unwrap();
let mut parser = ole::Reader::new(my_resume).unwrap();
Source

pub fn from_path(path: &str) -> Result<Reader<'_>, Error>

Constructs a new Reader from a file.

§Examples
use ole;
let mut parser = ole::Reader::from_path("assets/Thumbs.db").unwrap();
Source

pub fn iterate(&self) -> OLEIterator<'_>

Returns an iterator for directory entries of the OLE file.

§Examples
use ole;
let mut parser = ole::Reader::from_path("assets/Thumbs.db").unwrap();

for entry in parser.iterate() {
  println!("Entry {}", entry.name());
}
Source§

impl<'ole> Reader<'ole>

Source

pub fn get_entry_slice(&self, entry: &Entry) -> Result<EntrySlice<'_>, Error>

Returns the slice for the entry.

Auto Trait Implementations§

§

impl<'ole> Freeze for Reader<'ole>

§

impl<'ole> !RefUnwindSafe for Reader<'ole>

§

impl<'ole> !Send for Reader<'ole>

§

impl<'ole> !Sync for Reader<'ole>

§

impl<'ole> Unpin for Reader<'ole>

§

impl<'ole> !UnwindSafe for Reader<'ole>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.