Struct palmdb::PalmDB [] [src]

pub struct PalmDB<'a> {
    pub name: &'a str,
    pub version: u16,
    pub creation_date: u32,
    pub modified_date: u32,
    pub last_backup_date: u32,
    pub modification_number: u32,
    pub app_info_id: u32,
    pub sort_info_id: u32,
    pub type_: &'a str,
    pub creator: &'a str,
    pub unique_id_seed: u32,
    pub next_record_list_id: u32,
    // some fields omitted
}

Represents a parsed PalmDB

Records in the DB can be accessed using the .get method

Example

extern crate palmdb;
use std::fs::File;
use std::io::Read;
use palmdb::PalmDB;


let mut db_file = File::open("/path/to/some/palmdb/file")?;
let mut input = vec![];
db_file.read_to_end(&mut input);
let db = PalmDB::parse(&input);
let first_record = db.get(0);

Fields

should represent the number of seconds since the unix epoch, but see the note here: https://wiki.mobileread.com/wiki/PDB#PDB_Times

should represent the number of seconds since the unix epoch, but see the note here: https://wiki.mobileread.com/wiki/PDB#PDB_Times

should represent the number of seconds since the unix epoch, but see the note here: https://wiki.mobileread.com/wiki/PDB#PDB_Times

type_ and creator, together, represent the values in this table: https://wiki.mobileread.com/wiki/PDB#Palm_Database_File_Code

type_ and creator, together, represent the values in this table: https://wiki.mobileread.com/wiki/PDB#Palm_Database_File_Code

Methods

impl<'a> PalmDB<'a>
[src]

Takes a byte slice as input and attempts to parse it into a PalmDB structure

Returns the metadata for record number. If there is no record at that index, returns an Err

Retreives record number from the database. If the record number does not exist, returns an Err

Returns true if the 0x0002 bit is set for the DB

Returns true if the 0x0004 bit is set for the DB

Returns true if the 0x0008 bit is set for the DB

Returns true if the 0x0010 bit is set for the DB

Returns true if the 0x0020 bit is set for the DB

Returns true if the 0x0040 bit is set for the DB

Returns the number of records in the DB

Returns true if there are no records in the DB

Trait Implementations

impl<'a> Debug for PalmDB<'a>
[src]

Formats the value using the given formatter.

impl<'a> Clone for PalmDB<'a>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a> PartialEq for PalmDB<'a>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'a> Display for PalmDB<'a>
[src]

Formats the value using the given formatter. Read more