Type Definition arrow_array::array::GenericStringArray
source · pub type GenericStringArray<OffsetSize> = GenericByteArray<GenericStringType<OffsetSize>>;
Expand description
A GenericByteArray
for storing str
Implementations§
source§impl<OffsetSize: OffsetSizeTrait> GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> GenericStringArray<OffsetSize>
sourcepub const fn get_data_type() -> DataType
👎Deprecated: please use Self::DATA_TYPE
instead
pub const fn get_data_type() -> DataType
Self::DATA_TYPE
insteadGet the data type of the array.
sourcepub fn num_chars(&self, i: usize) -> usize
pub fn num_chars(&self, i: usize) -> usize
Returns the number of Unicode Scalar Value
in the string at index i
.
Performance
This function has O(n)
time complexity where n
is the string length.
If you can make sure that all chars in the string are in the range U+0x0000
~ U+0x007F
,
please use the function value_length
which has O(1) time complexity.
sourcepub fn from_iter_values<Ptr, I>(iter: I) -> Selfwhere
Ptr: AsRef<str>,
I: IntoIterator<Item = Ptr>,
pub fn from_iter_values<Ptr, I>(iter: I) -> Selfwhere Ptr: AsRef<str>, I: IntoIterator<Item = Ptr>,
Creates a GenericStringArray
based on an iterator of values without nulls
sourcepub fn take_iter<'a>(
&'a self,
indexes: impl Iterator<Item = Option<usize>> + 'a
) -> impl Iterator<Item = Option<&str>> + 'a
pub fn take_iter<'a>( &'a self, indexes: impl Iterator<Item = Option<usize>> + 'a ) -> impl Iterator<Item = Option<&str>> + 'a
Returns an iterator that returns the values of array.value(i)
for an iterator with each element i
sourcepub unsafe fn take_iter_unchecked<'a>(
&'a self,
indexes: impl Iterator<Item = Option<usize>> + 'a
) -> impl Iterator<Item = Option<&str>> + 'a
pub unsafe fn take_iter_unchecked<'a>( &'a self, indexes: impl Iterator<Item = Option<usize>> + 'a ) -> impl Iterator<Item = Option<&str>> + 'a
Returns an iterator that returns the values of array.value(i)
for an iterator with each element i
Safety
caller must ensure that the indexes in the iterator are less than the array.len()
sourcepub fn try_from_binary(
v: GenericBinaryArray<OffsetSize>
) -> Result<Self, ArrowError>
pub fn try_from_binary( v: GenericBinaryArray<OffsetSize> ) -> Result<Self, ArrowError>
Fallibly creates a GenericStringArray
from a GenericBinaryArray
returning
an error if GenericBinaryArray
contains invalid UTF-8 data