pub struct SectionEntry {
pub section_type: SectionType,
pub priority: Priority,
pub offset: u32,
pub length: u32,
pub token_count: u16,
pub flags: u32,
}Expand description
A single section entry in the section table
Fields§
§section_type: SectionTypeSection type identifier
priority: PriorityTruncation priority (0-255, higher = more important)
offset: u32Byte offset to section data (from start of file)
length: u32Section data length in bytes
token_count: u16Pre-computed token count estimate
flags: u32Section-specific flags (4 bytes for alignment)
Implementations§
Source§impl SectionEntry
impl SectionEntry
Sourcepub fn new(section_type: SectionType, offset: u32, length: u32) -> SectionEntry
pub fn new(section_type: SectionType, offset: u32, length: u32) -> SectionEntry
Create a new section entry with default priority
Sourcepub fn with_priority(self, priority: Priority) -> SectionEntry
pub fn with_priority(self, priority: Priority) -> SectionEntry
Create with explicit priority
Sourcepub fn with_token_count(self, count: u16) -> SectionEntry
pub fn with_token_count(self, count: u16) -> SectionEntry
Create with explicit token count
Sourcepub fn with_flags(self, flags: u32) -> SectionEntry
pub fn with_flags(self, flags: u32) -> SectionEntry
Create with section-specific flags
Sourcepub fn write<W>(&self, writer: &mut W) -> Result<(), FafbError>where
W: Write,
pub fn write<W>(&self, writer: &mut W) -> Result<(), FafbError>where
W: Write,
Write entry to a byte buffer
Sourcepub fn read<R>(reader: &mut R) -> Result<SectionEntry, FafbError>where
R: Read,
pub fn read<R>(reader: &mut R) -> Result<SectionEntry, FafbError>where
R: Read,
Read entry from a byte buffer
Sourcepub fn from_bytes(data: &[u8]) -> Result<SectionEntry, FafbError>
pub fn from_bytes(data: &[u8]) -> Result<SectionEntry, FafbError>
Read entry from a byte slice
Trait Implementations§
Source§impl Clone for SectionEntry
impl Clone for SectionEntry
Source§fn clone(&self) -> SectionEntry
fn clone(&self) -> SectionEntry
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 SectionEntry
impl Debug for SectionEntry
Source§impl PartialEq for SectionEntry
impl PartialEq for SectionEntry
impl Eq for SectionEntry
impl StructuralPartialEq for SectionEntry
Auto Trait Implementations§
impl Freeze for SectionEntry
impl RefUnwindSafe for SectionEntry
impl Send for SectionEntry
impl Sync for SectionEntry
impl Unpin for SectionEntry
impl UnsafeUnpin for SectionEntry
impl UnwindSafe for SectionEntry
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.