pub struct LocalHeap {
pub data_segment_size: u64,
pub free_list_offset: u64,
pub data_segment_address: u64,
}Expand description
A parsed HDF5 local heap header.
The data segment (containing the actual strings) is stored separately in
the file at data_segment_address.
Fields§
§data_segment_size: u64Size in bytes of the data segment.
free_list_offset: u64Offset to the head of the free-list within the data segment (relative to the start of the data segment).
data_segment_address: u64Absolute file address of the data segment.
Implementations§
Source§impl LocalHeap
impl LocalHeap
Sourcepub fn parse(
cursor: &mut Cursor<'_>,
offset_size: u8,
length_size: u8,
) -> Result<Self>
pub fn parse( cursor: &mut Cursor<'_>, offset_size: u8, length_size: u8, ) -> Result<Self>
Parse a local heap header at the current cursor position.
Format:
- Signature:
HEAP(4 bytes) - Version: 0 (1 byte)
- Reserved: 3 bytes
- Data segment size (
length_sizebytes) - Offset to head of free list (
length_sizebytes) - Data segment address (
offset_sizebytes)
Sourcepub fn get_string(&self, offset: u64, file_data: &[u8]) -> Result<String>
pub fn get_string(&self, offset: u64, file_data: &[u8]) -> Result<String>
Read a null-terminated string at the given offset within the heap’s data segment.
offset is relative to the start of the data segment (as stored in
SymbolTableEntry::link_name_offset). file_data must be the entire
file (or at least the portion containing the data segment).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LocalHeap
impl RefUnwindSafe for LocalHeap
impl Send for LocalHeap
impl Sync for LocalHeap
impl Unpin for LocalHeap
impl UnsafeUnpin for LocalHeap
impl UnwindSafe for LocalHeap
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> 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