pub struct GlobalHeapCollection {
pub objects: Vec<GlobalHeapObject>,
}Expand description
A parsed global heap collection containing zero or more heap objects.
Fields§
§objects: Vec<GlobalHeapObject>The heap objects in this collection.
Implementations§
Source§impl GlobalHeapCollection
impl GlobalHeapCollection
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 global heap collection at the current cursor position.
Format:
- Signature:
GCOL(4 bytes) - Version: 1 (1 byte)
- Reserved: 3 bytes
- Collection size (
length_sizebytes) — total size including header - Then global heap objects until the collection is exhausted.
Each global heap object:
- Heap object index (u16 LE)
- Reference count (u16 LE)
- Reserved (4 bytes)
- Object size (
length_sizebytes) - Object data (padded to 8-byte boundary)
- An index of 0 signals free space / end of objects.
Sourcepub fn get_object(&self, index: u16) -> Option<&GlobalHeapObject>
pub fn get_object(&self, index: u16) -> Option<&GlobalHeapObject>
Look up an object by its index within this collection.
Trait Implementations§
Source§impl Clone for GlobalHeapCollection
impl Clone for GlobalHeapCollection
Source§fn clone(&self) -> GlobalHeapCollection
fn clone(&self) -> GlobalHeapCollection
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 moreAuto Trait Implementations§
impl Freeze for GlobalHeapCollection
impl RefUnwindSafe for GlobalHeapCollection
impl Send for GlobalHeapCollection
impl Sync for GlobalHeapCollection
impl Unpin for GlobalHeapCollection
impl UnsafeUnpin for GlobalHeapCollection
impl UnwindSafe for GlobalHeapCollection
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