Skip to main content

Module string

Module string 

Source
Expand description

§StringArray Module - Mid-Level, Inner Typed String Array

Arrow-compatible UTF-8, variable-length string array backed by a compact offsets + data (+ optional null_mask) layout.

§Overview

  • Supports Arrow’s String (u32 offsets) and LargeString (u64 offsets).
  • Storage:
    • offsets: length = len + 1; i-th string = data[offsets[i]..offsets[i+1]]
    • data: concatenated UTF-8 bytes
    • null_mask (optional): Bitmask where 1 = valid, 0 = null
  • Zero-copy friendly and interops with the Arrow C Data Interface.
  • Append-oriented API with reserve/resize helpers and fast conversions (e.g., to CategoricalArray).

§Features

  • Builders: from_slice, from_vec, from_vec64, from_parts.
  • Mutation: push_str, set_str, push_null, push_nulls, reserve, resize.
  • Iteration: iter_str* (by value), optional parallel iterators behind parallel_proc.
  • Conversions: to_categorical_array().

§When to use

Use for variable-length UTF-8 text with Arrow interop, compact memory layout, and high-throughput append/scan workloads.

§Safety note

Trait methods from MaskedArray that return &'static str are for trait compatibility only-the data actually borrows from self. Prefer the *_str methods in this module for correct lifetime management.

Structs§

StringArray
StringArray