Compare two numeric MessagePack values as i64. Useful when the caller knows both values are integers.
(a_buf: &[u8], a_off: usize, b_buf: &[u8], b_off: usize)
| 116 | /// Compare two numeric MessagePack values as i64. |
| 117 | /// Useful when the caller knows both values are integers. |
| 118 | pub fn compare_field_i64(a_buf: &[u8], a_off: usize, b_buf: &[u8], b_off: usize) -> Ordering { |
| 119 | match (read_i64(a_buf, a_off), read_i64(b_buf, b_off)) { |
| 120 | (Some(a), Some(b)) => a.cmp(&b), |
| 121 | (Some(_), None) => Ordering::Greater, |
| 122 | (None, Some(_)) => Ordering::Less, |
| 123 | (None, None) => Ordering::Equal, |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | /// Check if two MessagePack values are byte-identical. |
| 128 | /// For canonical-encoded documents, byte equality implies semantic equality. |