[−][src]Crate mobi
An implementation of MOBI format data parsing and manipulation, written in Rust.
The code is available on GitHub
License: MIT
Examples
Access basic info
use mobi::Mobi; fn main() -> Result<(), std::io::Error> { let book = vec![0, 0, 0]; // You can either create a Mobi struct from a slice let m = Mobi::new(&book)?; // Or from an instance of io::Read let stdin = std::io::stdin(); let mut handle = stdin.lock(); let m = Mobi::from_read(&mut handle)?; // Or from filesystem let m = Mobi::from_path("/some/path/to/book.mobi")?; let empty = "".to_string(); // Access metadata let title = m.title().unwrap_or(&empty); let author = m.author().unwrap_or(&empty); let publisher = m.publisher().unwrap_or(&empty); let desc = m.description().unwrap_or(&empty); let isbn = m.isbn().unwrap_or(&empty); let pub_date = m.publish_date().unwrap_or(&empty); let contributor = m.contributor().unwrap_or(&empty); // 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 // Access content let content = m.content_as_string(); Ok(()) }
Modules
headers | Module with headers from book containg more extracted data not available through public API. |
Structs
Mobi | Structure that holds parsed ebook information and contents |
Record | A "cell" in the whole books content |