pub struct MutableBinaryArray<O: Offset> { /* private fields */ }
Expand description

The Arrow’s equivalent to Vec<Option<Vec<u8>>>. Converting a MutableBinaryArray into a BinaryArray is O(1).

Implementation

This struct does not allocate a validity until one is required (i.e. push a null to it).

Implementations§

Creates a new empty MutableBinaryArray.

Implementation

This allocates a Vec of one element

Returns a MutableBinaryArray created from its internal representation.

Errors

This function returns an error iff:

  • The last offset is not equal to the values’ length.
  • the validity’s length is not equal to offsets.len().
  • The data_type’s crate::datatypes::PhysicalType is not equal to either Binary or LargeBinary.
Implementation

This function is O(1)

Creates a new MutableBinaryArray from a slice of optional &[u8].

Initializes a new MutableBinaryArray with a pre-allocated capacity of slots.

Initializes a new MutableBinaryArray with a pre-allocated capacity of slots and values.

Implementation

This does not allocate the validity.

Reserves additional elements and additional_values on the values buffer.

Pushes a new element to the array.

Panic

This operation panics iff the length of all values (in bytes) exceeds O maximum value.

Pop the last entry from MutableBinaryArray. This function returns None iff this array is empty

Converts itself into an Array.

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

returns its values.

returns its offsets.

Returns an iterator of Option<&[u8]>

Returns an iterator over the values of this array

Creates a MutableBinaryArray from an iterator of trusted length.

Safety

The iterator must be TrustedLen. I.e. that size_hint().1 correctly reports its length.

Creates a MutableBinaryArray from an iterator of trusted length.

Creates a new BinaryArray from a TrustedLen of &[u8].

Safety

The iterator must be TrustedLen. I.e. that size_hint().1 correctly reports its length.

Creates a new BinaryArray from a TrustedLen of &[u8].

Creates a MutableBinaryArray from an falible iterator of trusted length.

Safety

The iterator must be TrustedLen. I.e. that size_hint().1 correctly reports its length.

Creates a MutableBinaryArray from an falible iterator of trusted length.

Extends the MutableBinaryArray from an iterator of trusted length. This differs from extend_trusted_len which accepts iterator of optional values.

Extends the MutableBinaryArray from an iterator of values. This differs from extended_trusted_len which accepts iterator of optional values.

Extends the MutableBinaryArray from an iterator of values of trusted length. This differs from extend_trusted_len_unchecked which accepts iterator of optional values.

Safety

The iterator must be TrustedLen

Extends the MutableBinaryArray from an iterator of TrustedLen

Extends the MutableBinaryArray from an iterator of TrustedLen

Safety

The iterator must be TrustedLen

Creates a new MutableBinaryArray from a Iterator of &[u8].

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Extends a collection with the contents of an iterator. Read more
🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Creates a value from an iterator. Read more
The length of the array.
The optional validity of the array.
Convert itself to an (immutable) Array.
Convert itself to an (immutable) atomically reference counted Array.
The DataType of the array.
Convert to Any, to enable dynamic casting.
Convert to mutable Any, to enable dynamic casting.
Adds a new null element to the array.
Reserves additional slots to its capacity.
Shrink the array to fit its length.
Whether the array is empty.
Whether index is valid / set. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Fallible version of Extend::extend.
Tries to extend itself with elements from other, failing only on overflow.
Tries to push a new element.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.