pub struct MutableDictionaryArray<K: DictionaryKey, M: MutableArray> { /* private fields */ }
Implementations§
Source§impl<K: DictionaryKey, M: MutableArray + Default> MutableDictionaryArray<K, M>
impl<K: DictionaryKey, M: MutableArray + Default> MutableDictionaryArray<K, M>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates an empty MutableDictionaryArray
.
Source§impl<K: DictionaryKey, M: MutableArray> MutableDictionaryArray<K, M>
impl<K: DictionaryKey, M: MutableArray> MutableDictionaryArray<K, M>
Sourcepub fn try_empty(values: M) -> PolarsResult<Self>
pub fn try_empty(values: M) -> PolarsResult<Self>
Creates an empty MutableDictionaryArray
from a given empty values array.
§Errors
Errors if the array is non-empty.
Sourcepub fn from_values(values: M) -> PolarsResult<Self>
pub fn from_values(values: M) -> PolarsResult<Self>
Creates an empty MutableDictionaryArray
preloaded with a given dictionary of values.
Indices associated with those values are automatically assigned based on the order of
the values.
§Errors
Errors if there’s more values than the maximum value of K
or if values are not unique.
Sourcepub fn into_empty(self) -> Self
pub fn into_empty(self) -> Self
Creates an empty MutableDictionaryArray
retaining the same dictionary as the current
mutable dictionary array, but with no data. This may come useful when serializing the
array into multiple chunks, where there’s a requirement that the dictionary is the same.
No copying is performed, the value map is moved over to the new array.
Sourcepub fn to_empty(&self) -> Selfwhere
M: Clone,
pub fn to_empty(&self) -> Selfwhere
M: Clone,
Same as into_empty
but clones the inner value map instead of taking full ownership.
Sourcepub fn into_arc(self) -> Arc<dyn Array>
pub fn into_arc(self) -> Arc<dyn Array>
converts itself into Arc<dyn Array>
Sourcepub fn into_box(self) -> Box<dyn Array>
pub fn into_box(self) -> Box<dyn Array>
converts itself into Box<dyn Array>
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the MutableDictionaryArray
to fit its current length.
Sourcepub fn keys(&self) -> &MutablePrimitiveArray<K>
pub fn keys(&self) -> &MutablePrimitiveArray<K>
Returns the dictionary keys
Trait Implementations§
Source§impl<K: Debug + DictionaryKey, M: Debug + MutableArray> Debug for MutableDictionaryArray<K, M>
impl<K: Debug + DictionaryKey, M: Debug + MutableArray> Debug for MutableDictionaryArray<K, M>
Source§impl<K: DictionaryKey, M: MutableArray + Default> Default for MutableDictionaryArray<K, M>
impl<K: DictionaryKey, M: MutableArray + Default> Default for MutableDictionaryArray<K, M>
Source§impl<K: DictionaryKey, M: MutableArray> From<MutableDictionaryArray<K, M>> for DictionaryArray<K>
impl<K: DictionaryKey, M: MutableArray> From<MutableDictionaryArray<K, M>> for DictionaryArray<K>
Source§fn from(other: MutableDictionaryArray<K, M>) -> Self
fn from(other: MutableDictionaryArray<K, M>) -> Self
Source§impl<K: DictionaryKey, M: 'static + MutableArray> MutableArray for MutableDictionaryArray<K, M>
impl<K: DictionaryKey, M: 'static + MutableArray> MutableArray for MutableDictionaryArray<K, M>
Source§fn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
Source§fn as_arc(&mut self) -> Arc<dyn Array>
fn as_arc(&mut self) -> Arc<dyn Array>
Array
.Source§fn dtype(&self) -> &ArrowDataType
fn dtype(&self) -> &ArrowDataType
ArrowDataType
of the array.Source§fn as_mut_any(&mut self) -> &mut dyn Any
fn as_mut_any(&mut self) -> &mut dyn Any
Any
, to enable dynamic casting.Source§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Source§impl<K, M, T> TryExtend<Option<T>> for MutableDictionaryArray<K, M>where
K: DictionaryKey,
M: MutableArray + Indexable + TryExtend<Option<T>> + TryPush<Option<T>>,
T: AsIndexed<M>,
M::Type: Eq + Hash,
impl<K, M, T> TryExtend<Option<T>> for MutableDictionaryArray<K, M>where
K: DictionaryKey,
M: MutableArray + Indexable + TryExtend<Option<T>> + TryPush<Option<T>>,
T: AsIndexed<M>,
M::Type: Eq + Hash,
Source§fn try_extend<II: IntoIterator<Item = Option<T>>>(
&mut self,
iter: II,
) -> PolarsResult<()>
fn try_extend<II: IntoIterator<Item = Option<T>>>( &mut self, iter: II, ) -> PolarsResult<()>
Extend::extend
.Source§impl<K, M, T> TryPush<Option<T>> for MutableDictionaryArray<K, M>where
K: DictionaryKey,
M: MutableArray + Indexable + TryPush<Option<T>>,
T: AsIndexed<M>,
M::Type: Eq + Hash,
impl<K, M, T> TryPush<Option<T>> for MutableDictionaryArray<K, M>where
K: DictionaryKey,
M: MutableArray + Indexable + TryPush<Option<T>>,
T: AsIndexed<M>,
M::Type: Eq + Hash,
Auto Trait Implementations§
impl<K, M> Freeze for MutableDictionaryArray<K, M>where
M: Freeze,
impl<K, M> RefUnwindSafe for MutableDictionaryArray<K, M>where
M: RefUnwindSafe,
impl<K, M> Send for MutableDictionaryArray<K, M>
impl<K, M> Sync for MutableDictionaryArray<K, M>
impl<K, M> Unpin for MutableDictionaryArray<K, M>
impl<K, M> UnwindSafe for MutableDictionaryArray<K, M>where
M: UnwindSafe,
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more