Skip to main content

compare_field_bytes

Function compare_field_bytes 

Source
pub fn compare_field_bytes(
    a_buf: &[u8],
    a_range: (usize, usize),
    b_buf: &[u8],
    b_range: (usize, usize),
) -> Ordering
Expand description

Compare two MessagePack values by their decoded content.

Comparison order:

  1. Null < Bool < Number < String < Binary < Array < Map
  2. Within numbers: compare as f64
  3. Within strings: lexicographic on raw bytes (valid UTF-8 guarantees byte order = Unicode code-point order for ASCII/Latin-1)
  4. Fallback: raw byte comparison