pub struct TextArrayV {
pub array: TextArray,
pub offset: usize,
/* private fields */
}Expand description
§TextArrayView
Borrowed, indexable view into a [offset .. offset + len) window of a
TextArray.
§Purpose
- Zero-copy access to contiguous UTF-8 values in either
StringArrayorCategoricalArrayform. - Allows null counts for the view to be cached to speed up scans.
§Fields
array: the backingTextArray.offset: starting index of the view.len: number of logical elements in the view.null_count: cachedOption<usize>of nulls for this range.
§Notes
TextArrayVis not thread-safe due to its use ofCellfor caching the null count.- Use
sliceto derive smaller views from this one. - Use
to_text_arrayto materialise the data.
Fields§
§array: TextArrayThe outer array that this view is derived from - we retain a reference to it. Importantly, this is the full array - not the view, and thus should not be accessed as though it were the view subset.
offset: usizeThe index offset from 0 that for where this view starts from the outer array
Implementations§
Source§impl TextArrayV
impl TextArrayV
Sourcepub fn new(array: TextArray, offset: usize, len: usize) -> TextArrayV
pub fn new(array: TextArray, offset: usize, len: usize) -> TextArrayV
Creates a new TextArrayView with the given offset and length.
Sourcepub fn new_nc(
array: TextArray,
offset: usize,
len: usize,
null_count: usize,
) -> TextArrayV
pub fn new_nc( array: TextArray, offset: usize, len: usize, null_count: usize, ) -> TextArrayV
Creates a new TextArrayView with a precomputed null count.
Sourcepub fn get_str(&self, i: usize) -> Option<&str>
pub fn get_str(&self, i: usize) -> Option<&str>
Returns the value at logical index i as an Option<&str>.
Sourcepub fn slice(&self, offset: usize, len: usize) -> TextArrayV
pub fn slice(&self, offset: usize, len: usize) -> TextArrayV
Returns a sliced view into a subrange of this view.
Sourcepub fn inner_array(&self) -> Array
pub fn inner_array(&self) -> Array
Returns the full backing array wrapped as an Array enum, ignoring the view’s offset and length.
Use this to access inner array methods. The returned array is the unwindowed original.
Sourcepub fn to_text_array(&self) -> TextArray
pub fn to_text_array(&self) -> TextArray
Returns an owned TextArray clone of the window.
Sourcepub fn as_tuple(&self) -> (TextArray, usize, usize)
pub fn as_tuple(&self) -> (TextArray, usize, usize)
Returns the view as a tuple (array, offset, len).
Sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
Returns the number of nulls in the view.
Caches it after the first calculation.
Sourcepub fn null_mask_view(&self) -> Option<BitmaskV>
pub fn null_mask_view(&self) -> Option<BitmaskV>
Returns the null mask as a windowed BitmaskView.
Trait Implementations§
Source§impl Clone for TextArrayV
impl Clone for TextArrayV
Source§fn clone(&self) -> TextArrayV
fn clone(&self) -> TextArrayV
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Concatenate for TextArrayV
impl Concatenate for TextArrayV
Source§fn concat(self, other: TextArrayV) -> Result<TextArrayV, MinarrowError>
fn concat(self, other: TextArrayV) -> Result<TextArrayV, MinarrowError>
Concatenates two text array views by materialising both to owned text arrays, concatenating them, and wrapping the result back in a view.
§Notes
- This operation copies data from both views to create owned text arrays.
- The resulting view has offset=0 and length equal to the combined length.
Source§impl Debug for TextArrayV
impl Debug for TextArrayV
Source§impl Display for TextArrayV
impl Display for TextArrayV
Source§impl<'a> From<&'a [&'a str]> for TextArrayV
impl<'a> From<&'a [&'a str]> for TextArrayV
Source§fn from(strings: &'a [&'a str]) -> TextArrayV
fn from(strings: &'a [&'a str]) -> TextArrayV
Source§impl From<Array> for TextArrayV
impl From<Array> for TextArrayV
Source§fn from(array: Array) -> TextArrayV
fn from(array: Array) -> TextArrayV
Source§impl From<ArrayV> for TextArrayV
impl From<ArrayV> for TextArrayV
Source§fn from(view: ArrayV) -> TextArrayV
fn from(view: ArrayV) -> TextArrayV
Source§impl From<TextArray> for TextArrayV
impl From<TextArray> for TextArrayV
Source§fn from(array: TextArray) -> TextArrayV
fn from(array: TextArray) -> TextArrayV
Source§impl From<TextArrayV> for ArrayV
Available on crate feature views only.TextArrayView -> ArrayView
impl From<TextArrayV> for ArrayV
views only.TextArrayView -> ArrayView
Converts by wrapping the inner TextArray as Array::TextArray.