pub struct FillValueMessage {
pub alloc_time: u8,
pub fill_write_time: u8,
pub fill_defined: u8,
pub fill_value: Option<Vec<u8>>,
}Expand description
Fill value message payload.
Fields§
§alloc_time: u8Space allocation time: 1=early, 2=late, 3=incremental.
fill_write_time: u8Fill value write time: 0=on alloc, 1=never, 2=if set.
fill_defined: u8Fill value defined: 0=undefined, 1=default (zeros), 2=user-defined.
fill_value: Option<Vec<u8>>User-defined fill value data. Present only when fill_defined == 2.
Implementations§
Source§impl FillValueMessage
impl FillValueMessage
Sourcepub fn with_value(data: Vec<u8>) -> Self
pub fn with_value(data: Vec<u8>) -> Self
A user-defined fill value.
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Encode as a version-3 fill-value message (H5O__fill_new_encode).
Sourcepub fn encode_for(&self, format: ObjectFormat) -> Vec<u8> ⓘ
pub fn encode_for(&self, format: ObjectFormat) -> Vec<u8> ⓘ
Encode at the version a file of this format calls for
(H5O__fill_new_encode, H5Ofill.c:409).
Version 2 spells out allocation time, write time and definedness as
three bytes instead of packing them into flags, and — the part a
version-3 reader must not assume — always writes the four-byte size
field when the value is defined, even when the size is zero. That
defined = 1, size = 0 shape is what libhdf5 writes for the default
fill of a contiguous dataset in a classic file.
Sourcepub fn decode(buf: &[u8]) -> FormatResult<(Self, usize)>
pub fn decode(buf: &[u8]) -> FormatResult<(Self, usize)>
Decode a fill-value message of version 1, 2, or 3.