[−][src]Crate mobi
An implementation of MOBI format data parsing and manipulation, written in Rust.
The code is available on GitHub
License: Apache-2.0
Examples
Print the whole book into stdout
ⓘThis example is not tested
use mobi::Mobi; fn main() { let m = Mobi::new("/home/wojtek/Downloads/lotr.mobi").unwrap(); println!("{}", m.content_raw().unwrap()); }
Access basic info
src/main.rs
ⓘThis example is not tested
use mobi::Mobi; fn main() { let m = Mobi::new("/home/wojtek/Downloads/lotr.mobi").unwrap(); let title = m.title().unwrap(); let author = m.author().unwrap(); let publisher = m.publisher().unwrap(); let desc = m.description().unwrap(); let isbn = m.isbn().unwrap(); let pub_date = m.publish_date().unwrap(); let contributor = m.contributor().unwrap(); println!("{}\n{}\n{}\n{}\n{}\n{}\n{}\n", title, author, publisher, isbn, pub_date, desc, contributor); // Access Headers let header = m.header; // Normal Header let pdheader = m.palmdoc; // PalmDOC Header let mheader = m.mobi; // MOBI Header let exth = m.exth // Extra Header }
Print all info
This feature is only available with features = ["fmt"]
src/main.rs
ⓘThis example is not tested
use mobi::Mobi; fn main() { let m = Mobi::new("/home/wojtek/Downloads/lotr.mobi").unwrap(); println!("{}", m) }
Structs
ExtHeader | Strcture that holds Exth header information |
Header | Strcture that holds header information |
Mobi | Structure that holds parsed ebook information and contents |
MobiHeader | Strcture that holds Mobi header information |
PalmDocHeader | Strcture that holds PalmDOC header information |
Record | A "cell" in the whole books content |