Skip to main content

hurray_descriptor_field_u64

Function hurray_descriptor_field_u64 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn hurray_descriptor_field_u64( handle: *const HurrayDescriptor, field: HurrayDescriptorField, level: u32, out_value: *mut u64, ) -> HurrayStatus
Expand description

Reads an unsigned or boolean scalar field of the descriptor.

Covers every scalar field that is unsigned or boolean, which is all of them but two: a boolean reads as 0 or 1, and a wire tag byte — kv_role, block_table_index_type, scale_type, member_role, the quantization scheme tag — reads as its documented value. The two exceptions are hurray_descriptor_field_i64 and hurray_descriptor_field_f64.

§Arguments

  • handle — Descriptor created by hurray_descriptor_decode.
  • field — One of the HURRAY_*_FIELD_* unsigned scalar constants.
  • level — Tiled nesting level to read; MUST be 0 for every other layout and for every section field.
  • out_value — Non-null pointer; written only on HURRAY_OK.

§Errors

  • HURRAY_ERR_FIELD_NOT_APPLICABLE — field does not belong to this descriptor’s layout or quantization scheme, or is not an unsigned scalar.
  • HURRAY_ERR_FIELD_NOT_PRESENT — the field is optional and this descriptor does not carry it: an absent section, an unset optional field, or a statistic whose computed_mask guard bit is clear.
  • HURRAY_ERR_INDEX_OUT_OF_BOUNDS — level exceeds the nesting depth, or is non-zero for a field that does not nest.

§Safety

handle and out_value MUST be valid, non-null pointers, and handle MUST NOT have been destroyed.