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

source

pub const SIZE: usize = 78usize

source

pub fn from_bytes(rdr: &mut Cursor<&[u8]>) -> Result<Self, Error>

Read the database header from the given byte slice.

source

pub fn to_bytes(&self) -> Result<Vec<u8>>

source

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).

source

pub fn name_try_str<'x>(&'x self) -> Result<&'x str, Utf8Error>

Attempt to convert the friendly name of the database to a str

source

pub fn type_code_try_str<'x>(&'x self) -> Result<&'x str, Utf8Error>

Attempt to convert the database type code to a str

source

pub fn creator_code_try_str<'x>(&'x self) -> Result<&'x str, Utf8Error>

Attempt to convert the database creator code to a str

Trait Implementations§

source§

impl Clone for DatabaseHeader

source§

fn clone(&self) -> DatabaseHeader

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DatabaseHeader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for DatabaseHeader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<DatabaseHeader> for DatabaseHeader

source§

fn eq(&self, other: &DatabaseHeader) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for DatabaseHeader

source§

impl StructuralPartialEq for DatabaseHeader

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.