Enum palmrs_database::record::pdb_record::PdbRecordHeader
source · pub enum PdbRecordHeader {
Record {
attributes: RecordAttributes,
unique_id: u32,
data_offset: u32,
data_len: Option<u32>,
},
Resource {
name: [u8; 4],
record_id: u16,
data_offset: u32,
data_len: Option<u32>,
},
}
Expand description
Generic Palm database record header
This type can represent either a “record” or a “resource” within a Palm OS database:
- Records are potentially-mutable entries that are used in PDB databases to represent content;
- Resources are generally-immutable data entries that are used, as the name would suggest, for application resources, and are found within PRC files.
Which type to use to decode a given record header should be determined by the lowest bit in the
attributes
field of the DatabaseHeader
for this record’s containing database - if that
bit is cleared, “records” are used; if it is set, “resources” are used.
These two types are presented as an enum
for the sake of flexibility, and to allow sharing
encoding/decoding code between the two available record header types.
Variants§
Trait Implementations§
source§impl Clone for PdbRecordHeader
impl Clone for PdbRecordHeader
source§fn clone(&self) -> PdbRecordHeader
fn clone(&self) -> PdbRecordHeader
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 DatabaseRecord for PdbRecordHeader
impl DatabaseRecord for PdbRecordHeader
source§fn from_bytes(
hdr: &DatabaseHeader,
rdr: &mut Cursor<&[u8]>
) -> Result<Self, Error>
fn from_bytes( hdr: &DatabaseHeader, rdr: &mut Cursor<&[u8]> ) -> Result<Self, Error>
Read the record header from the given byte array
source§fn attributes(&self) -> Option<RecordAttributes>
fn attributes(&self) -> Option<RecordAttributes>
Return the record’s attributes, if known
source§fn resource_id(&self) -> Option<u16>
fn resource_id(&self) -> Option<u16>
Return the resource id if the record is a resource
source§fn construct_record(
attributes: RecordAttributes,
unique_id: u32,
data_offset: u32,
data_len: Option<u32>
) -> Self
fn construct_record( attributes: RecordAttributes, unique_id: u32, data_offset: u32, data_len: Option<u32> ) -> Self
Construct a record with the given parameters
source§impl Debug for PdbRecordHeader
impl Debug for PdbRecordHeader
source§impl PartialEq<PdbRecordHeader> for PdbRecordHeader
impl PartialEq<PdbRecordHeader> for PdbRecordHeader
source§fn eq(&self, other: &PdbRecordHeader) -> bool
fn eq(&self, other: &PdbRecordHeader) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for PdbRecordHeader
impl StructuralPartialEq for PdbRecordHeader
Auto Trait Implementations§
impl RefUnwindSafe for PdbRecordHeader
impl Send for PdbRecordHeader
impl Sync for PdbRecordHeader
impl Unpin for PdbRecordHeader
impl UnwindSafe for PdbRecordHeader
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