Skip to main content

SharedMessagePointer

Struct SharedMessagePointer 

Source
pub struct SharedMessagePointer {
    pub version: u8,
    pub location: SharedLocation,
    pub heap_id: [u8; 8],
    pub oh_addr: u64,
}
Expand description

A decoded shared-message pointer: the body of any object-header message whose H5O_MSG_FLAG_SHARED bit is set.

Fields§

§version: u8

Encoding version: 1, 2 or 3.

§location: SharedLocation

Which storage the pointer names.

§heap_id: [u8; 8]

Fractal-heap ID, for Sohm.

§oh_addr: u64

Object header address, for Committed (and for the version-1 form, which is always committed).

Implementations§

Source§

impl SharedMessagePointer

Source

pub fn decode(buf: &[u8], ctx: &FormatContext) -> FormatResult<Self>

Decode the pointer that stands in for the message body.

Source

pub fn committed(oh_addr: u64) -> Self

The pointer a dataset (or attribute) built on a committed datatype stores in place of the message body.

H5O__shared_encode picks version 2 for H5O_SHARE_TYPE_COMMITTED — version 3 exists for the heap form, which needs a flag byte version 2 has no room for — so a committed pointer libhdf5 wrote and one written here agree byte for byte.

Source

pub fn encode_committed(oh_addr: u64, ctx: &FormatContext) -> Vec<u8> ⓘ

Encode the committed form — the inverse of decode for the one shape this crate writes.

Only the committed form is produced, so this takes the address rather than a pointer and cannot fail: nothing here shares through the SOHM heap, and the version-1 form libhdf5 no longer writes has a symbol table entry in it that nothing here can fill.

Source

pub fn encode_sohm(heap_id: [u8; 8]) -> Vec<u8> ⓘ

The pointer a header stores in place of a message whose body was moved to the shared-message fractal heap.

Version 3, where the committed form stays at version 2: only version 3 has the type byte free to mean H5O_SHARE_TYPE_SOHM, and its body is the fixed-width heap ID rather than an address, so it does not follow the file’s address size.

Trait Implementations§

Source§

impl Clone for SharedMessagePointer

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SharedMessagePointer

Source§

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

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

impl Eq for SharedMessagePointer

Source§

impl PartialEq for SharedMessagePointer

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SharedMessagePointer

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.