pub struct AttributeMessage {
pub name: String,
pub dtype: DataType,
pub dataspace: DataspaceMessage,
pub raw_value: Bytes,
}Expand description
An HDF5 attribute (name-value pair attached to a group or dataset).
Message type 0x000C.
Fields§
§name: StringAttribute name.
dtype: DataTypeData type of the attribute value.
dataspace: DataspaceMessageDataspace (dimensionality) of the attribute.
raw_value: BytesRaw value bytes.
Implementations§
Source§impl AttributeMessage
impl AttributeMessage
Sourcepub fn decode(&self) -> AttributeValue
pub fn decode(&self) -> AttributeValue
Decode the raw value bytes into a typed AttributeValue.
Sourcepub fn to_attribute(&self) -> Attribute
pub fn to_attribute(&self) -> Attribute
Convert this message to a resolved Attribute with decoded value.
Sourcepub async fn decode_with_reader(
&self,
reader: &Arc<dyn AsyncFileReader>,
size_of_offsets: u8,
size_of_lengths: u8,
) -> Result<AttributeValue>
pub async fn decode_with_reader( &self, reader: &Arc<dyn AsyncFileReader>, size_of_offsets: u8, size_of_lengths: u8, ) -> Result<AttributeValue>
Decode the raw value, resolving variable-length data via the global heap.
This handles the common case of vlen strings written by h5py (the default).
Falls back to decode() for non-vlen types.
Sourcepub async fn to_attribute_resolved(
&self,
reader: &Arc<dyn AsyncFileReader>,
size_of_offsets: u8,
size_of_lengths: u8,
) -> Result<Attribute>
pub async fn to_attribute_resolved( &self, reader: &Arc<dyn AsyncFileReader>, size_of_offsets: u8, size_of_lengths: u8, ) -> Result<Attribute>
Async version of to_attribute that resolves vlen data.
Trait Implementations§
Source§impl Clone for AttributeMessage
impl Clone for AttributeMessage
Source§fn clone(&self) -> AttributeMessage
fn clone(&self) -> AttributeMessage
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 AttributeMessage
impl RefUnwindSafe for AttributeMessage
impl Send for AttributeMessage
impl Sync for AttributeMessage
impl Unpin for AttributeMessage
impl UnsafeUnpin for AttributeMessage
impl UnwindSafe for AttributeMessage
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