Skip to main content

extract_field

Function extract_field 

Source
pub fn extract_field(
    buf: &[u8],
    offset: usize,
    field: &str,
) -> Option<FieldRange>
Expand description

Locate the value for field in a MessagePack map starting at offset. Returns the byte range (value_start, value_end) of the matched value.

Scans map keys sequentially — O(n) in number of keys. For documents with many fields queried repeatedly, see structural indexing (Phase 8).

§Returns

  • Some((start, end)) — the value’s byte range (use offset start with readers)
  • None — field not found, or buffer is not a valid map