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

A MutableArray that builds a Utf8Array. It differs from MutableUtf8ValuesArray in that it can build nullable Utf8Arrays.

Implementations

Initializes a new empty MutableUtf8Array.

Returns a MutableUtf8Array created from its internal representation.

Errors

This function returns an error iff:

  • the offsets are not monotonically increasing
  • The last offset is not equal to the values’ length.
  • the validity’s length is not equal to offsets.len() - 1.
  • The data_type’s crate::datatypes::PhysicalType is not equal to either Utf8 or LargeUtf8.
  • The values between two consecutive offsets are not valid utf8
Implementation

This function is O(N) - checking monotinicity and utf8 is O(N)

Create a MutableUtf8Array out of low-end APIs.

Safety

The caller must ensure that every value between offsets is a valid utf8.

Panics

This function panics iff:

  • The offsets and values are inconsistent
  • The validity is not None and its length is different from offsets’s length minus one.

Alias of new_unchecked

Safety

The caller must ensure that every value between offsets is a valid utf8.

The canonical method to create a MutableUtf8Array out of low-end APIs.

Panics

This function panics iff:

  • The offsets and values are inconsistent
  • The values between offsets are not utf8 encoded
  • The validity is not None and its length is different from offsets’s length minus one.

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

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

Reserves additional elements and additional_values on the values buffer.

Reserves additional elements and additional_values on the values buffer.

Returns the length of this array

Pushes a new element to the array.

Panic

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

Returns the value of the element at index i, ignoring the array’s validity.

Safety

This function is safe iff i < self.len.

Returns the value of the element at index i, ignoring the array’s validity.

Safety

This function is safe iff i < self.len.

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

Returns an iterator of Option<&str>

Converts itself into an Array.

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

Extract the low-end APIs from the MutableUtf8Array.

Returns an iterator of &str

returns its values.

returns its offsets.

Extends the MutableUtf8Array from an iterator of values of trusted len. This differs from extended_trusted_len which accepts iterator of optional values.

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

Extends the MutableUtf8Array from an iterator of values of trusted len. This differs from extended_trusted_len_unchecked which accepts iterator of optional values.

Safety

The iterator must be trusted len.

Extends the MutableUtf8Array from an iterator of trusted len.

Extends MutableUtf8Array from an iterator of trusted len.

Safety

The iterator must be trusted len.

Creates a MutableUtf8Array from an iterator of trusted length.

Safety

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

Creates a MutableUtf8Array from an iterator of trusted length.

Creates a MutableUtf8Array from an iterator of trusted length of &str.

Safety

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

Creates a new MutableUtf8Array from a TrustedLen of &str.

Creates a MutableUtf8Array 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 MutableUtf8Array from an falible iterator of trusted length.

Creates a new MutableUtf8Array from a Iterator of &str.

Trait Implementations

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 type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. 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
Fallible version of Extend::extend.
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 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.