Struct re_sdk::external::arrow2::array::MutableDictionaryArray

source ·
pub struct MutableDictionaryArray<K, M>{ /* 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, M> MutableDictionaryArray<K, M>

source

pub fn new() -> MutableDictionaryArray<K, M>

Creates an empty MutableDictionaryArray.

source§

impl<K, M> MutableDictionaryArray<K, M>

source

pub fn try_empty(values: M) -> Result<MutableDictionaryArray<K, M>, Error>

Creates an empty MutableDictionaryArray from a given empty values array.

§Errors

Errors if the array is non-empty.

source

pub fn from_values(values: M) -> Result<MutableDictionaryArray<K, M>, Error>
where M: Indexable, <M as Indexable>::Type: Eq + Hash,

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.

source

pub fn into_empty(self) -> MutableDictionaryArray<K, M>

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.

source

pub fn to_empty(&self) -> MutableDictionaryArray<K, M>
where M: Clone,

Same as into_empty but clones the inner value map instead of taking full ownership.

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 keys(&self) -> &MutablePrimitiveArray<K>

Returns the dictionary keys

Trait Implementations§

source§

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

source§

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

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

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

source§

fn default() -> MutableDictionaryArray<K, M>

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

impl<K, M> From<MutableDictionaryArray<K, M>> for DictionaryArray<K>

source§

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

Converts to this type from the input type.
source§

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

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 + 'static)

Convert to Any, to enable dynamic casting.
source§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

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> TryExtend<Option<T>> for MutableDictionaryArray<K, M>
where K: DictionaryKey, M: MutableArray + Indexable + TryExtend<Option<T>>, T: AsIndexed<M>, <M as Indexable>::Type: Eq + Hash,

source§

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

Fallible version of 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 as Indexable>::Type: Eq + Hash,

source§

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

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>
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>
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> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
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.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.