pub struct GlobalHeapCollection {
pub objects: Vec<GlobalHeapObject>,
}Expand description
A global heap collection, containing a set of heap objects.
Fields§
§objects: Vec<GlobalHeapObject>The heap objects in this collection (index > 0).
Implementations§
Source§impl GlobalHeapCollection
impl GlobalHeapCollection
Sourcepub fn add_object(&mut self, data: Vec<u8>) -> u16
pub fn add_object(&mut self, data: Vec<u8>) -> u16
Add a data blob to the collection. Returns the 1-based object index.
Sourcepub fn get_object(&self, index: u16) -> Option<&[u8]>
pub fn get_object(&self, index: u16) -> Option<&[u8]>
Retrieve the data for an object by its 1-based index.
Sourcepub fn encode(&self, ctx: &FormatContext) -> Vec<u8> ⓘ
pub fn encode(&self, ctx: &FormatContext) -> Vec<u8> ⓘ
Encode the collection into a byte vector.
The encoded blob includes the GCOL header and all heap objects, followed by a free-space marker (index=0 object). The total size is padded to at least 4096 bytes (H5HG_MINALLOC) for compatibility with the HDF5 C library.
Sourcepub fn decode(buf: &[u8], ctx: &FormatContext) -> FormatResult<(Self, usize)>
pub fn decode(buf: &[u8], ctx: &FormatContext) -> FormatResult<(Self, usize)>
Decode a global heap collection from a byte buffer.
Returns the collection and the number of bytes consumed.
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 moreSource§impl Debug for GlobalHeapCollection
impl Debug for GlobalHeapCollection
Source§impl Default for GlobalHeapCollection
impl Default for GlobalHeapCollection
Source§impl PartialEq for GlobalHeapCollection
impl PartialEq for GlobalHeapCollection
impl Eq for GlobalHeapCollection
impl StructuralPartialEq for GlobalHeapCollection
Auto 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