Struct arrow2::array::MutableDictionaryArray

source ·
pub struct MutableDictionaryArray<K: DictionaryKey, M: MutableArray> { /* private fields */ }
Expand description

A mutable, strong-typed version of DictionaryArray.

§Example

Building a UTF8 dictionary with i32 keys.

let mut array: MutableDictionaryArray<i32, MutableUtf8Array<i32>> = MutableDictionaryArray::new();
array.try_push(Some("A"))?;
array.try_push(Some("B"))?;
array.push_null();
array.try_push(Some("C"))?;

Implementations§

source§

impl<K: DictionaryKey, M: MutableArray + Default> MutableDictionaryArray<K, M>

source

pub fn new() -> Self

Creates an empty MutableDictionaryArray.

source§

impl<K: DictionaryKey, M: MutableArray> MutableDictionaryArray<K, M>

source

pub fn push_null(&mut self)

pushes a null value

source

pub fn values(&self) -> &M

returns a reference to the inner values.

source

pub fn into_arc(self) -> Arc<dyn Array>

converts itself into Arc<dyn Array>

source

pub fn into_box(self) -> Box<dyn Array>

converts itself into Box<dyn Array>

source

pub fn reserve(&mut self, additional: usize)

Reserves additional slots.

source

pub fn shrink_to_fit(&mut self)

Shrinks the capacity of the MutableDictionaryArray to fit its current length.

source

pub fn map(&self) -> &HashedMap<u64, K>

Returns the dictionary map

source

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>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K: DictionaryKey, M: MutableArray + Default> Default for MutableDictionaryArray<K, M>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<K: DictionaryKey, M: MutableArray> From<M> for MutableDictionaryArray<K, M>

source§

fn from(values: M) -> Self

Converts to this type from the input type.
source§

impl<K: DictionaryKey, M: MutableArray> From<MutableDictionaryArray<K, M>> for DictionaryArray<K>

source§

fn from(other: MutableDictionaryArray<K, M>) -> Self

Converts to this type from the input type.
source§

impl<K: DictionaryKey, M: 'static + MutableArray> MutableArray for MutableDictionaryArray<K, M>

source§

fn len(&self) -> usize

The length of the array.
source§

fn validity(&self) -> Option<&MutableBitmap>

The optional validity of the array.
source§

fn as_box(&mut self) -> Box<dyn Array>

Convert itself to an (immutable) Array.
source§

fn as_arc(&mut self) -> Arc<dyn Array>

Convert itself to an (immutable) atomically reference counted Array.
source§

fn data_type(&self) -> &DataType

The DataType of the array.
source§

fn as_any(&self) -> &dyn Any

Convert to Any, to enable dynamic casting.
source§

fn as_mut_any(&mut self) -> &mut dyn Any

Convert to mutable Any, to enable dynamic casting.
source§

fn push_null(&mut self)

Adds a new null element to the array.
source§

fn reserve(&mut self, additional: usize)

Reserves additional slots to its capacity.
source§

fn shrink_to_fit(&mut self)

Shrink the array to fit its length.
source§

fn is_empty(&self) -> bool

Whether the array is empty.
source§

fn is_valid(&self, index: usize) -> bool

Whether index is valid / set. Read more
source§

impl<K, M, T: Hash> TryExtend<Option<T>> for MutableDictionaryArray<K, M>

source§

fn try_extend<II: IntoIterator<Item = Option<T>>>( &mut self, iter: II ) -> Result<()>

Fallible version of Extend::extend.
source§

impl<K, M, T> TryPush<Option<T>> for MutableDictionaryArray<K, M>
where K: DictionaryKey, M: MutableArray + TryPush<Option<T>>, T: Hash,

source§

fn try_push(&mut self, item: Option<T>) -> Result<()>

Tries to push a new element.

Auto Trait Implementations§

§

impl<K, M> Freeze for MutableDictionaryArray<K, M>
where M: Freeze,

§

impl<K, M> RefUnwindSafe for MutableDictionaryArray<K, M>

§

impl<K, M> Send for MutableDictionaryArray<K, M>

§

impl<K, M> Sync for MutableDictionaryArray<K, M>

§

impl<K, M> Unpin for MutableDictionaryArray<K, M>
where M: Unpin, K: Unpin,

§

impl<K, M> UnwindSafe for MutableDictionaryArray<K, M>
where M: UnwindSafe, K: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.