Struct palmrs_database::header::DatabaseHeader
source · pub struct DatabaseHeader {Show 14 fields
pub name: [u8; 32],
pub attributes: u16,
pub version: u16,
pub creation_time: PalmTimestamp,
pub modification_time: PalmTimestamp,
pub backup_time: PalmTimestamp,
pub modification_number: u32,
pub app_info_id: u32,
pub sort_info_id: u32,
pub type_code: [u8; 4],
pub creator_code: [u8; 4],
pub unique_id_seed: u32,
pub next_record_list: u32,
pub record_count: u16,
}
Expand description
The common file header used by both the PRC and PDB databases.
This is located at the start of the database (offset 0
).
Fields§
§name: [u8; 32]
§attributes: u16
§version: u16
§creation_time: PalmTimestamp
§modification_time: PalmTimestamp
§backup_time: PalmTimestamp
§modification_number: u32
§app_info_id: u32
§sort_info_id: u32
§type_code: [u8; 4]
§creator_code: [u8; 4]
§unique_id_seed: u32
§next_record_list: u32
§record_count: u16
Implementations§
source§impl DatabaseHeader
impl DatabaseHeader
pub const SIZE: usize = 78usize
sourcepub fn from_bytes(rdr: &mut Cursor<&[u8]>) -> Result<Self, Error>
pub fn from_bytes(rdr: &mut Cursor<&[u8]>) -> Result<Self, Error>
Read the database header from the given byte slice.
pub fn to_bytes(&self) -> Result<Vec<u8>>
sourcepub fn name_trimmed<'x>(&'x self) -> &'x [u8] ⓘ
pub fn name_trimmed<'x>(&'x self) -> &'x [u8] ⓘ
Return the friendly name of the database as a byte slice, containing only the data bytes of the name (that is, the null terminating bytes are trimmed).
sourcepub fn name_try_str<'x>(&'x self) -> Result<&'x str, Utf8Error>
pub fn name_try_str<'x>(&'x self) -> Result<&'x str, Utf8Error>
Attempt to convert the friendly name of the database to a str
Trait Implementations§
source§impl Clone for DatabaseHeader
impl Clone for DatabaseHeader
source§fn clone(&self) -> DatabaseHeader
fn clone(&self) -> DatabaseHeader
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DatabaseHeader
impl Debug for DatabaseHeader
source§impl Display for DatabaseHeader
impl Display for DatabaseHeader
source§impl PartialEq<DatabaseHeader> for DatabaseHeader
impl PartialEq<DatabaseHeader> for DatabaseHeader
source§fn eq(&self, other: &DatabaseHeader) -> bool
fn eq(&self, other: &DatabaseHeader) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for DatabaseHeader
impl StructuralPartialEq for DatabaseHeader
Auto Trait Implementations§
impl RefUnwindSafe for DatabaseHeader
impl Send for DatabaseHeader
impl Sync for DatabaseHeader
impl Unpin for DatabaseHeader
impl UnwindSafe for DatabaseHeader
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more