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>
impl<'ole> Reader<'ole>
Sourcepub fn new<T>(readable: T) -> Result<Reader<'ole>, Error>where
T: Read + 'ole,
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();
Sourcepub fn from_path(path: &str) -> Result<Reader<'_>, Error>
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();
Sourcepub fn iterate(&self) -> OLEIterator<'_> ⓘ
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>
impl<'ole> Reader<'ole>
Sourcepub fn get_entry_slice(&self, entry: &Entry) -> Result<EntrySlice<'_>, Error>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more