Decodes a string array from `rows` with the provided `options` # Safety The row must contain valid UTF-8 data
(
rows: &mut [&[u8]],
options: SortOptions,
validate_utf8: bool,
)
| 404 | /// |
| 405 | /// The row must contain valid UTF-8 data |
| 406 | pub unsafe fn decode_string<I: OffsetSizeTrait>( |
| 407 | rows: &mut [&[u8]], |
| 408 | options: SortOptions, |
| 409 | validate_utf8: bool, |
| 410 | ) -> GenericStringArray<I> { |
| 411 | let decoded = decode_binary::<I>(rows, options); |
| 412 | |
| 413 | if validate_utf8 { |
| 414 | return GenericStringArray::from(decoded); |
| 415 | } |
| 416 | |
| 417 | let builder = decoded |
| 418 | .into_data() |
| 419 | .into_builder() |
| 420 | .data_type(GenericStringArray::<I>::DATA_TYPE); |
| 421 | |
| 422 | // SAFETY: |
| 423 | // Row data must have come from a valid UTF-8 array |
| 424 | GenericStringArray::from(unsafe { builder.build_unchecked() }) |
| 425 | } |
| 426 | |
| 427 | /// Decodes a string view array from `rows` with the provided `options` |
| 428 | /// |
nothing calls this directly
no test coverage detected