Variable length values are encoded as - single `0_u8` if null - single `1_u8` if empty array - `2_u8` if not empty, followed by one or more blocks where a block is encoded as - [`BLOCK_SIZE`] bytes of string data, padded with 0s - `0xFF_u8` if this is not the last block for this string - otherwise the length of the block as a `u8`
(
data: &mut [u8],
offsets: &mut [usize],
i: I,
opts: SortOptions,
)
| 81 | /// - `0xFF_u8` if this is not the last block for this string |
| 82 | /// - otherwise the length of the block as a `u8` |
| 83 | pub fn encode<'a, I: Iterator<Item = Option<&'a [u8]>>>( |
| 84 | data: &mut [u8], |
| 85 | offsets: &mut [usize], |
| 86 | i: I, |
| 87 | opts: SortOptions, |
| 88 | ) { |
| 89 | for (offset, maybe_val) in offsets.iter_mut().skip(1).zip(i) { |
| 90 | *offset += encode_one(&mut data[*offset..], maybe_val, opts); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | /// Calls [`encode`] with optimized iterator for generic byte arrays |
| 95 | pub(crate) fn encode_generic_byte_array<T: ByteArrayType>( |
no test coverage detected