Skip to main content

encode_revised_blob

Function encode_revised_blob 

Source
pub fn encode_revised_blob(
    address: u64,
    target: &ReferenceTarget,
    extent_rank: usize,
    ctx: &FormatContext,
) -> FormatResult<Vec<u8>>
Expand description

The encoded reference a 1.12 blob holds, less the two-byte header the element keeps — H5R__encode from the token onwards, which is exactly what decode_revised_body reads back.

The token is written as address; a caller that does not know the target’s object header address yet passes 0 and patches those sa bytes at offset REVISED_BLOB_TOKEN_OFFSET once it does.

extent_rank is the rank of the dataspace the reference’s selection is over, which is what H5R__encode_region encodes and where it takes it from — H5S_get_simple_extent_ndims of the space, not the serialized selection, which is why an H5S_SEL_ALL region still says a rank. It is 0 for the two kinds that carry no selection.