Skip to main content

LocalHeapImage

Struct LocalHeapImage 

Source
pub struct LocalHeapImage { /* private fields */ }
Expand description

A local heap’s data segment, built up object by object.

This is the bulk-load half of H5HL_insert: every object is placed at the end of the block and the block grows to fit, which is what that function does once its free list is empty. The free list itself is not modelled — the writer rebuilds a group’s heap whole rather than patching the one on disk, so there is never a hole to record.

Implementations§

Source§

impl LocalHeapImage

Source

pub fn with_empty_string() -> Self

A heap holding just the empty string at offset 0.

Not an optimisation: H5G__stab_create_components asserts that offset, because a symbol-table B-tree’s leftmost key is the empty string and every comparison against it reads heap offset 0.

Source

pub fn insert(&mut self, bytes: &[u8]) -> u64

Append bytes (null terminator included) and return its offset.

Source

pub fn insert_str(&mut self, s: &str) -> u64

Append a name as a null-terminated string, returning its offset.

Source

pub fn as_bytes(&self) -> &[u8] ⓘ

The data segment’s bytes, whose length is the heap’s data_size.

Trait Implementations§

Source§

impl Debug for LocalHeapImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LocalHeapImage

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.