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
name: &'a str
version: u16
creation_date: u32
should represent the number of seconds since the unix epoch, but see the note here: https://wiki.mobileread.com/wiki/PDB#PDB_Times
modified_date: u32
should represent the number of seconds since the unix epoch, but see the note here: https://wiki.mobileread.com/wiki/PDB#PDB_Times
last_backup_date: u32
should represent the number of seconds since the unix epoch, but see the note here: https://wiki.mobileread.com/wiki/PDB#PDB_Times
modification_number: u32
app_info_id: u32
sort_info_id: u32
type_: &'a str
type_
and creator
, together, represent the values in
this table: https://wiki.mobileread.com/wiki/PDB#Palm_Database_File_Code
creator: &'a str
type_
and creator
, together, represent the values in
this table: https://wiki.mobileread.com/wiki/PDB#Palm_Database_File_Code
unique_id_seed: u32
next_record_list_id: u32
Methods
impl<'a> PalmDB<'a>
[src]
fn parse(input: &'a [u8]) -> Result<PalmDB<'a>>
Takes a byte slice as input and attempts to parse it into a PalmDB
structure
fn record_info(&self, number: usize) -> Result<RecordInfo>
Returns the metadata for record number
. If there is no record at that index,
returns an Err
fn get(&self, number: usize) -> Result<&'a [u8]>
Retreives record number
from the database. If the
record number does not exist, returns an Err
fn is_read_only(&self) -> bool
Returns true if the 0x0002
bit is set for the DB
fn app_info_area_is_dirty(&self) -> bool
Returns true if the 0x0004
bit is set for the DB
fn do_backup(&self) -> bool
Returns true if the 0x0008
bit is set for the DB
fn okay_to_install_over(&self) -> bool
Returns true if the 0x0010
bit is set for the DB
fn do_force_reset(&self) -> bool
Returns true if the 0x0020
bit is set for the DB
fn no_allow_copy(&self) -> bool
Returns true if the 0x0040
bit is set for the DB
fn len(&self) -> usize
Returns the number of records in the DB
fn is_empty(&self) -> bool
Returns true if there are no records in the DB
Trait Implementations
impl<'a> Debug for PalmDB<'a>
[src]
impl<'a> Clone for PalmDB<'a>
[src]
fn clone(&self) -> PalmDB<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'a> PartialEq for PalmDB<'a>
[src]
fn eq(&self, __arg_0: &PalmDB<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PalmDB<'a>) -> bool
This method tests for !=
.