pub(super) enum HeaderExtension {
BackingFileFormat(String),
FeatureNameTable(HashMap<(FeatureType, u8), String>),
ExternalDataFileName(String),
Unknown {
extension_type: u32,
data: Vec<u8>,
},
}
Expand description
Header extensions (high-level representation).
Variants§
BackingFileFormat(String)
Backing file format string.
FeatureNameTable(HashMap<(FeatureType, u8), String>)
Map of feature bits to human-readable names.
ExternalDataFileName(String)
External data file filename string.
Unknown
Unknown extension.
Implementations§
Source§impl HeaderExtension
impl HeaderExtension
Sourcefn deserialize(ext_type: u32, data: Vec<u8>) -> Result<Option<Self>>
fn deserialize(ext_type: u32, data: Vec<u8>) -> Result<Option<Self>>
Parse an extension from its type and data. Unrecognized types are stored as Unknown
extensions, encountering the end of extensions returns Ok(None)
.
Sourcefn extension_type(&self) -> u32
fn extension_type(&self) -> u32
Return the extension type ID.
Sourcefn serialize_data(&self) -> Result<Vec<u8>>
fn serialize_data(&self) -> Result<Vec<u8>>
Serialize this extension’s data (exclusing its header).
Sourcefn feature_name_table() -> Self
fn feature_name_table() -> Self
Creates a Self::FeatureNameTable
.
Trait Implementations§
Source§impl Clone for HeaderExtension
impl Clone for HeaderExtension
Source§fn clone(&self) -> HeaderExtension
fn clone(&self) -> HeaderExtension
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 HeaderExtension
impl Debug for HeaderExtension
Source§impl PartialEq for HeaderExtension
impl PartialEq for HeaderExtension
impl Eq for HeaderExtension
impl StructuralPartialEq for HeaderExtension
Auto Trait Implementations§
impl Freeze for HeaderExtension
impl RefUnwindSafe for HeaderExtension
impl Send for HeaderExtension
impl Sync for HeaderExtension
impl Unpin for HeaderExtension
impl UnwindSafe for HeaderExtension
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