#[repr(C)]pub struct FileHeader {
pub magic: [u8; 8],
pub version: u32,
pub total_count: u32,
pub export_mode: u8,
pub user_count: u16,
pub system_count: u16,
pub features_enabled: u8,
pub unsafe_report_count: u32,
pub passport_count: u32,
pub reserved: u16,
}
Expand description
Enhanced file header structure (32 bytes fixed size) Extended to include safety analysis and passport tracking information
Fields§
§magic: [u8; 8]
§version: u32
§total_count: u32
§export_mode: u8
§user_count: u16
§system_count: u16
§features_enabled: u8
§unsafe_report_count: u32
§passport_count: u32
§reserved: u16
Implementations§
Source§impl FileHeader
impl FileHeader
Sourcepub fn new(
total_count: u32,
export_mode: BinaryExportMode,
user_count: u16,
system_count: u16,
) -> Self
pub fn new( total_count: u32, export_mode: BinaryExportMode, user_count: u16, system_count: u16, ) -> Self
Create a new file header with enhanced information
Sourcepub fn new_legacy(count: u32) -> Self
pub fn new_legacy(count: u32) -> Self
Create a legacy header for backward compatibility
pub fn is_valid_magic(&self) -> bool
pub fn is_compatible_version(&self) -> bool
pub fn get_version(&self) -> u32
pub fn is_legacy_version(&self) -> bool
Sourcepub fn get_export_mode(&self) -> BinaryExportMode
pub fn get_export_mode(&self) -> BinaryExportMode
Get the export mode from the header
Sourcepub fn is_user_only(&self) -> bool
pub fn is_user_only(&self) -> bool
Check if this is a user-only binary
Sourcepub fn is_full_binary(&self) -> bool
pub fn is_full_binary(&self) -> bool
Check if this is a full binary
Sourcepub fn get_allocation_counts(&self) -> (u32, u16, u16)
pub fn get_allocation_counts(&self) -> (u32, u16, u16)
Get allocation count information
Sourcepub fn is_count_consistent(&self) -> bool
pub fn is_count_consistent(&self) -> bool
Validate allocation count consistency
Sourcepub fn from_bytes(bytes: &[u8; 32]) -> Self
pub fn from_bytes(bytes: &[u8; 32]) -> Self
Create header from bytes using Little Endian format
Trait Implementations§
Source§impl Clone for FileHeader
impl Clone for FileHeader
Source§fn clone(&self) -> FileHeader
fn clone(&self) -> FileHeader
Returns a duplicate 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 FileHeader
impl Debug for FileHeader
Source§impl<'de> Deserialize<'de> for FileHeader
impl<'de> Deserialize<'de> for FileHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FileHeader
impl PartialEq for FileHeader
Source§impl Serialize for FileHeader
impl Serialize for FileHeader
impl StructuralPartialEq for FileHeader
Auto Trait Implementations§
impl Freeze for FileHeader
impl RefUnwindSafe for FileHeader
impl Send for FileHeader
impl Sync for FileHeader
impl Unpin for FileHeader
impl UnwindSafe for FileHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more