Struct arrow2::array::DictionaryArray
source · [−]pub struct DictionaryArray<K: DictionaryKey> { /* private fields */ }
Expand description
Implementations
sourceimpl<'a, K: DictionaryKey> DictionaryArray<K>
impl<'a, K: DictionaryKey> DictionaryArray<K>
sourcepub fn iter(
&'a self
) -> ZipValidity<'a, Box<dyn Scalar>, DictionaryValuesIter<'a, K>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I: Iterator<Item = T>> Iterator for ZipValidity<'a, T, I> type Item = Option<T>;
pub fn iter(
&'a self
) -> ZipValidity<'a, Box<dyn Scalar>, DictionaryValuesIter<'a, K>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I: Iterator<Item = T>> Iterator for ZipValidity<'a, T, I> type Item = Option<T>;
Returns an iterator of Option<Box<dyn Array>>
sourcepub fn values_iter(&'a self) -> DictionaryValuesIter<'a, K>
pub fn values_iter(&'a self) -> DictionaryValuesIter<'a, K>
Returns an iterator of Box<dyn Array>
sourceimpl<K: DictionaryKey> DictionaryArray<K>
impl<K: DictionaryKey> DictionaryArray<K>
sourcepub fn new_empty(data_type: DataType) -> Self
pub fn new_empty(data_type: DataType) -> Self
Returns a new empty DictionaryArray
.
sourcepub fn new_null(data_type: DataType, length: usize) -> Self
pub fn new_null(data_type: DataType, length: usize) -> Self
Returns an DictionaryArray
whose all elements are null
sourcepub fn from_data(keys: PrimitiveArray<K>, values: Arc<dyn Array>) -> Self
pub fn from_data(keys: PrimitiveArray<K>, values: Arc<dyn Array>) -> Self
The canonical method to create a new DictionaryArray
.
sourcepub fn slice(&self, offset: usize, length: usize) -> Self
pub fn slice(&self, offset: usize, length: usize) -> Self
Creates a new DictionaryArray
by slicing the existing DictionaryArray
.
Panics
iff offset + length > self.len()
.
sourcepub unsafe fn slice_unchecked(&self, offset: usize, length: usize) -> Self
pub unsafe fn slice_unchecked(&self, offset: usize, length: usize) -> Self
Creates a new DictionaryArray
by slicing the existing DictionaryArray
.
Safety
Safe iff offset + length <= self.len()
.
sourceimpl<K: DictionaryKey> DictionaryArray<K>
impl<K: DictionaryKey> DictionaryArray<K>
sourcepub fn validity(&self) -> Option<&Bitmap>
pub fn validity(&self) -> Option<&Bitmap>
The optional validity. Equivalent to self.keys().validity()
.
sourcepub fn keys(&self) -> &PrimitiveArray<K>
pub fn keys(&self) -> &PrimitiveArray<K>
Returns the keys of the DictionaryArray
. These keys can be used to fetch values
from values
.
sourcepub fn values(&self) -> &Arc<dyn Array>
pub fn values(&self) -> &Arc<dyn Array>
Returns the values of the DictionaryArray
.
Trait Implementations
sourceimpl<K: DictionaryKey> Array for DictionaryArray<K>
impl<K: DictionaryKey> Array for DictionaryArray<K>
sourcefn data_type(&self) -> &DataType
fn data_type(&self) -> &DataType
The DataType
of the Array
. In combination with Array::as_any
, this can be
used to downcast trait objects (dyn Array
) to concrete arrays. Read more
sourcefn null_count(&self) -> usize
fn null_count(&self) -> usize
sourceimpl<K: Clone + DictionaryKey> Clone for DictionaryArray<K>
impl<K: Clone + DictionaryKey> Clone for DictionaryArray<K>
sourcefn clone(&self) -> DictionaryArray<K>
fn clone(&self) -> DictionaryArray<K>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<K: DictionaryKey> Debug for DictionaryArray<K>
impl<K: DictionaryKey> Debug for DictionaryArray<K>
sourceimpl<'a, T: DictionaryKey> From<GrowableDictionary<'a, T>> for DictionaryArray<T>
impl<'a, T: DictionaryKey> From<GrowableDictionary<'a, T>> for DictionaryArray<T>
sourcefn from(val: GrowableDictionary<'a, T>) -> Self
fn from(val: GrowableDictionary<'a, T>) -> Self
Performs the conversion.
sourceimpl<K: DictionaryKey, M: MutableArray> From<MutableDictionaryArray<K, M>> for DictionaryArray<K>
impl<K: DictionaryKey, M: MutableArray> From<MutableDictionaryArray<K, M>> for DictionaryArray<K>
sourcefn from(other: MutableDictionaryArray<K, M>) -> Self
fn from(other: MutableDictionaryArray<K, M>) -> Self
Performs the conversion.
sourceimpl<'a, K: DictionaryKey> IntoIterator for &'a DictionaryArray<K>
impl<'a, K: DictionaryKey> IntoIterator for &'a DictionaryArray<K>
sourceimpl<K: DictionaryKey> PartialEq<&'_ (dyn Array + '_)> for DictionaryArray<K>
impl<K: DictionaryKey> PartialEq<&'_ (dyn Array + '_)> for DictionaryArray<K>
sourceimpl<K: DictionaryKey> PartialEq<DictionaryArray<K>> for DictionaryArray<K>
impl<K: DictionaryKey> PartialEq<DictionaryArray<K>> for DictionaryArray<K>
Auto Trait Implementations
impl<K> !RefUnwindSafe for DictionaryArray<K>
impl<K> Send for DictionaryArray<K>
impl<K> Sync for DictionaryArray<K>
impl<K> Unpin for DictionaryArray<K>
impl<K> !UnwindSafe for DictionaryArray<K>
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more