[][src]Struct mobi::MobiHeader

pub struct MobiHeader {
    pub identifier: u32,
    pub header_length: u32,
    pub mobi_type: u32,
    pub text_encoding: u32,
    pub id: u32,
    pub gen_version: u32,
    pub first_non_book_index: u32,
    pub name: String,
    pub name_offset: u32,
    pub name_length: u32,
    pub language_code: u16,
    pub input_language: u32,
    pub output_language: u32,
    pub format_version: u32,
    pub first_image_index: u32,
    pub first_huff_record: u32,
    pub huff_record_count: u32,
    pub first_data_record: u32,
    pub data_record_count: u32,
    pub exth_flags: u32,
    pub has_exth_header: bool,
    pub has_drm: bool,
    pub drm_offset: u32,
    pub drm_count: u32,
    pub drm_size: u32,
    pub drm_flags: u32,
    pub last_image_record: u16,
    pub fcis_record: u32,
    pub flis_record: u32,
    pub extra_bytes: u32,
}

Strcture that holds Mobi header information

Fields

identifier: u32header_length: u32mobi_type: u32text_encoding: u32id: u32gen_version: u32first_non_book_index: u32name: Stringname_offset: u32name_length: u32language_code: u16input_language: u32output_language: u32format_version: u32first_image_index: u32first_huff_record: u32huff_record_count: u32first_data_record: u32data_record_count: u32exth_flags: u32has_exth_header: boolhas_drm: booldrm_offset: u32drm_count: u32drm_size: u32drm_flags: u32last_image_record: u16fcis_record: u32flis_record: u32extra_bytes: u32

Methods

impl MobiHeader[src]

pub fn parse(content: &[u8], num_of_records: u16) -> Result<MobiHeader, Error>[src]

Parse a Mobi header from the content

pub fn name(content: &[u8], num_of_records: u16) -> Result<String, Error>[src]

Returns the book name

pub fn has_exth_header(exth_flags: u32) -> bool[src]

Checks if there is a Exth Header and changes the parameter

pub fn mobi_type(&self) -> Option<String>[src]

Converts numerical value into a type

pub fn text_encoding(&self) -> Option<String>[src]

pub fn language(&self) -> Option<String>[src]

Trait Implementations

impl PartialEq<MobiHeader> for MobiHeader[src]

impl Default for MobiHeader[src]

impl Display for MobiHeader[src]

impl Debug for MobiHeader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]