[−][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::init("/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::init("/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
src/main.rs
ⓘThis example is not tested
use mobi::Mobi; fn main() { let m = Mobi::init("/home/wojtek/Downloads/lotr.mobi").unwrap(); println!("{}", m) }
Modules
exth | A module about ext header |
header | A module about palmdoc header |
mobih | A module about mobi header |
palmdoch | A module about palmdoc header |
Structs
Mobi | Structure that holds parsed ebook information and contents |
Record | A "cell" in the whole books content |