Struct arrow::array::GenericStringArray
source · [−]pub struct GenericStringArray<OffsetSize: OffsetSizeTrait> { /* private fields */ }
Expand description
Generic struct for [Large]StringArray
See StringArray
and LargeStringArray
for storing
specific string data.
Implementations
sourceimpl<OffsetSize: OffsetSizeTrait> GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> GenericStringArray<OffsetSize>
sourcepub fn get_data_type() -> DataType
pub fn get_data_type() -> DataType
Get the data type of the array.
sourcepub fn value_length(&self, i: usize) -> OffsetSize
pub fn value_length(&self, i: usize) -> OffsetSize
Returns the length for the element at index i
.
sourcepub fn value_offsets(&self) -> &[OffsetSize]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn value_offsets(&self) -> &[OffsetSize]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
Returns the offset values in the offsets buffer
sourcepub fn value_data(&self) -> Buffer
pub fn value_data(&self) -> Buffer
Returns a clone of the value data buffer
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 unsafe fn value_unchecked(&self, i: usize) -> &str
pub unsafe fn value_unchecked(&self, i: usize) -> &str
Returns the element at index
Safety
caller is responsible for ensuring that index is within the array bounds
sourcepub fn from_iter_values<Ptr, I>(iter: I) -> Self where
Ptr: AsRef<str>,
I: IntoIterator<Item = Ptr>,
pub fn from_iter_values<Ptr, I>(iter: I) -> Self where
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()
sourceimpl<'a, T: OffsetSizeTrait> GenericStringArray<T>
impl<'a, T: OffsetSizeTrait> GenericStringArray<T>
sourcepub fn iter(&'a self) -> GenericStringIter<'a, T>ⓘNotable traits for GenericStringIter<'a, T>impl<'a, T: OffsetSizeTrait> Iterator for GenericStringIter<'a, T> type Item = Option<&'a str>;
pub fn iter(&'a self) -> GenericStringIter<'a, T>ⓘNotable traits for GenericStringIter<'a, T>impl<'a, T: OffsetSizeTrait> Iterator for GenericStringIter<'a, T> type Item = Option<&'a str>;
constructs a new iterator
Trait Implementations
sourceimpl<OffsetSize: OffsetSizeTrait> Array for GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> Array for GenericStringArray<OffsetSize>
sourcefn data_ref(&self) -> &ArrayData
fn data_ref(&self) -> &ArrayData
Returns a reference-counted pointer to the underlying data of this array.
sourcefn slice(&self, offset: usize, length: usize) -> ArrayRef
fn slice(&self, offset: usize, length: usize) -> ArrayRef
Returns a zero-copy slice of this array with the indicated offset and length. Read more
sourcefn offset(&self) -> usize
fn offset(&self) -> usize
Returns the offset into the underlying data used by this array(-slice).
Note that the underlying data can be shared by many arrays.
This defaults to 0
. Read more
sourcefn is_null(&self, index: usize) -> bool
fn is_null(&self, index: usize) -> bool
Returns whether the element at index
is null.
When using this function on a slice, the index is relative to the slice. Read more
sourcefn is_valid(&self, index: usize) -> bool
fn is_valid(&self, index: usize) -> bool
Returns whether the element at index
is not null.
When using this function on a slice, the index is relative to the slice. Read more
sourcefn null_count(&self) -> usize
fn null_count(&self) -> usize
Returns the total number of null values in this array. Read more
sourcefn get_buffer_memory_size(&self) -> usize
fn get_buffer_memory_size(&self) -> usize
Returns the total number of bytes of memory pointed to by this array. The buffers store bytes in the Arrow memory format, and include the data as well as the validity map. Read more
sourcefn get_array_memory_size(&self) -> usize
fn get_array_memory_size(&self) -> usize
Returns the total number of bytes of memory occupied physically by this array.
This value will always be greater than returned by get_buffer_memory_size()
and
includes the overhead of the data structures that contain the pointers to the various buffers. Read more
sourcefn to_raw(&self) -> Result<(*const FFI_ArrowArray, *const FFI_ArrowSchema)>
fn to_raw(&self) -> Result<(*const FFI_ArrowArray, *const FFI_ArrowSchema)>
returns two pointers that represent this array in the C Data Interface (FFI)
sourceimpl<OffsetSize: OffsetSizeTrait> Debug for GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> Debug for GenericStringArray<OffsetSize>
sourceimpl<OffsetSize: OffsetSizeTrait> From<ArrayData> for GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> From<ArrayData> for GenericStringArray<OffsetSize>
sourceimpl<T: OffsetSizeTrait> From<GenericListArray<T>> for GenericStringArray<T>
impl<T: OffsetSizeTrait> From<GenericListArray<T>> for GenericStringArray<T>
sourcefn from(v: GenericListArray<T>) -> Self
fn from(v: GenericListArray<T>) -> Self
Converts to this type from the input type.
sourceimpl<OffsetSize: OffsetSizeTrait> From<Vec<&'_ str, Global>> for GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> From<Vec<&'_ str, Global>> for GenericStringArray<OffsetSize>
sourceimpl<OffsetSize: OffsetSizeTrait> From<Vec<Option<&'_ str>, Global>> for GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> From<Vec<Option<&'_ str>, Global>> for GenericStringArray<OffsetSize>
sourceimpl<OffsetSize: OffsetSizeTrait> From<Vec<String, Global>> for GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> From<Vec<String, Global>> for GenericStringArray<OffsetSize>
sourceimpl<'a, Ptr, OffsetSize: OffsetSizeTrait> FromIterator<&'a Option<Ptr>> for GenericStringArray<OffsetSize> where
Ptr: AsRef<str> + 'a,
impl<'a, Ptr, OffsetSize: OffsetSizeTrait> FromIterator<&'a Option<Ptr>> for GenericStringArray<OffsetSize> where
Ptr: AsRef<str> + 'a,
sourcefn from_iter<I: IntoIterator<Item = &'a Option<Ptr>>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = &'a Option<Ptr>>>(iter: I) -> Self
Creates a GenericStringArray
based on an iterator of Option
references.
sourceimpl<'a, Ptr, OffsetSize: OffsetSizeTrait> FromIterator<Option<Ptr>> for GenericStringArray<OffsetSize> where
Ptr: AsRef<str>,
impl<'a, Ptr, OffsetSize: OffsetSizeTrait> FromIterator<Option<Ptr>> for GenericStringArray<OffsetSize> where
Ptr: AsRef<str>,
sourcefn from_iter<I: IntoIterator<Item = Option<Ptr>>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = Option<Ptr>>>(iter: I) -> Self
Creates a GenericStringArray
based on an iterator of Option
s
sourceimpl<'a, T: OffsetSizeTrait> IntoIterator for &'a GenericStringArray<T>
impl<'a, T: OffsetSizeTrait> IntoIterator for &'a GenericStringArray<T>
sourceimpl<OffsetSize: OffsetSizeTrait> JsonEqual for GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> JsonEqual for GenericStringArray<OffsetSize>
sourceimpl<OffsetSize: OffsetSizeTrait> PartialEq<GenericStringArray<OffsetSize>> for GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> PartialEq<GenericStringArray<OffsetSize>> for GenericStringArray<OffsetSize>
sourceimpl<OffsetSize: OffsetSizeTrait> PartialEq<GenericStringArray<OffsetSize>> for Value
impl<OffsetSize: OffsetSizeTrait> PartialEq<GenericStringArray<OffsetSize>> for Value
Auto Trait Implementations
impl<OffsetSize> RefUnwindSafe for GenericStringArray<OffsetSize> where
OffsetSize: RefUnwindSafe,
impl<OffsetSize> Send for GenericStringArray<OffsetSize>
impl<OffsetSize> Sync for GenericStringArray<OffsetSize>
impl<OffsetSize> Unpin for GenericStringArray<OffsetSize>
impl<OffsetSize> UnwindSafe for GenericStringArray<OffsetSize> where
OffsetSize: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more