pub struct MutableUtf8Array<O> where
O: Offset, { /* private fields */ }
Expand description
The mutable version of Utf8Array
. See MutableArray
for more details.
Implementations
sourceimpl<O> MutableUtf8Array<O> where
O: Offset,
impl<O> MutableUtf8Array<O> where
O: Offset,
sourcepub fn new() -> MutableUtf8Array<O>
pub fn new() -> MutableUtf8Array<O>
Initializes a new empty MutableUtf8Array
.
sourcepub fn from_data(
data_type: DataType,
offsets: Vec<O, Global>,
values: Vec<u8, Global>,
validity: Option<MutableBitmap>
) -> MutableUtf8Array<O>
pub fn from_data(
data_type: DataType,
offsets: Vec<O, Global>,
values: Vec<u8, Global>,
validity: Option<MutableBitmap>
) -> MutableUtf8Array<O>
The canonical method to create a MutableUtf8Array
out of low-end APIs.
Panics
This function panics iff:
- The
offsets
andvalues
are inconsistent - The
values
betweenoffsets
are not utf8 encoded - The validity is not
None
and its length is different fromoffsets
’s length minus one.
sourcepub unsafe fn from_data_unchecked(
data_type: DataType,
offsets: Vec<O, Global>,
values: Vec<u8, Global>,
validity: Option<MutableBitmap>
) -> MutableUtf8Array<O>
pub unsafe fn from_data_unchecked(
data_type: DataType,
offsets: Vec<O, Global>,
values: Vec<u8, Global>,
validity: Option<MutableBitmap>
) -> MutableUtf8Array<O>
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
andvalues
are inconsistent - The validity is not
None
and its length is different fromoffsets
’s length minus one.
sourcepub fn with_capacity(capacity: usize) -> MutableUtf8Array<O>
pub fn with_capacity(capacity: usize) -> MutableUtf8Array<O>
Initializes a new MutableUtf8Array
with a pre-allocated capacity of slots.
sourcepub fn with_capacities(capacity: usize, values: usize) -> MutableUtf8Array<O>
pub fn with_capacities(capacity: usize, values: usize) -> MutableUtf8Array<O>
Initializes a new MutableUtf8Array
with a pre-allocated capacity of slots and values.
sourcepub fn reserve(&mut self, additional: usize, additional_values: usize)
pub fn reserve(&mut self, additional: usize, additional_values: usize)
Reserves additional
elements and additional_values
on the values buffer.
sourcepub fn push<T>(&mut self, value: Option<T>) where
T: AsRef<str>,
pub fn push<T>(&mut self, value: Option<T>) where
T: AsRef<str>,
Pushes a new element to the array.
Panic
This operation panics iff the length of all values (in bytes) exceeds O
maximum value.
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the MutableUtf8Array
to fit its current length.
sourceimpl<O> MutableUtf8Array<O> where
O: Offset,
impl<O> MutableUtf8Array<O> where
O: Offset,
sourceimpl<O> MutableUtf8Array<O> where
O: Offset,
impl<O> MutableUtf8Array<O> where
O: Offset,
sourcepub fn extend_trusted_len_values<I, P>(&mut self, iterator: I) where
P: AsRef<str>,
I: TrustedLen<Item = P>,
pub fn extend_trusted_len_values<I, P>(&mut self, iterator: I) where
P: AsRef<str>,
I: TrustedLen<Item = P>,
Extends the MutableUtf8Array
from an iterator of values of trusted len.
This differs from extended_trusted_len
which accepts iterator of optional values.
sourcepub fn extend_values<I, P>(&mut self, iterator: I) where
P: AsRef<str>,
I: Iterator<Item = P>,
pub fn extend_values<I, P>(&mut self, iterator: I) where
P: AsRef<str>,
I: Iterator<Item = P>,
Extends the MutableUtf8Array
from an iterator of values.
This differs from extended_trusted_len
which accepts iterator of optional values.
sourcepub unsafe fn extend_trusted_len_values_unchecked<I, P>(&mut self, iterator: I) where
P: AsRef<str>,
I: Iterator<Item = P>,
pub unsafe fn extend_trusted_len_values_unchecked<I, P>(&mut self, iterator: I) where
P: AsRef<str>,
I: Iterator<Item = P>,
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.
sourcepub fn extend_trusted_len<I, P>(&mut self, iterator: I) where
P: AsRef<str>,
I: TrustedLen<Item = Option<P>>,
pub fn extend_trusted_len<I, P>(&mut self, iterator: I) where
P: AsRef<str>,
I: TrustedLen<Item = Option<P>>,
Extends the MutableUtf8Array
from an iterator of trusted len.
sourcepub unsafe fn extend_trusted_len_unchecked<I, P>(&mut self, iterator: I) where
P: AsRef<str>,
I: Iterator<Item = Option<P>>,
pub unsafe fn extend_trusted_len_unchecked<I, P>(&mut self, iterator: I) where
P: AsRef<str>,
I: Iterator<Item = Option<P>>,
sourcepub unsafe fn from_trusted_len_iter_unchecked<I, P>(
iterator: I
) -> MutableUtf8Array<O> where
P: AsRef<str>,
I: Iterator<Item = Option<P>>,
pub unsafe fn from_trusted_len_iter_unchecked<I, P>(
iterator: I
) -> MutableUtf8Array<O> where
P: AsRef<str>,
I: Iterator<Item = Option<P>>,
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.
sourcepub fn from_trusted_len_iter<I, P>(iterator: I) -> MutableUtf8Array<O> where
P: AsRef<str>,
I: TrustedLen<Item = Option<P>>,
pub fn from_trusted_len_iter<I, P>(iterator: I) -> MutableUtf8Array<O> where
P: AsRef<str>,
I: TrustedLen<Item = Option<P>>,
Creates a MutableUtf8Array
from an iterator of trusted length.
sourcepub unsafe fn from_trusted_len_values_iter_unchecked<T, I>(
iterator: I
) -> MutableUtf8Array<O> where
T: AsRef<str>,
I: Iterator<Item = T>,
pub unsafe fn from_trusted_len_values_iter_unchecked<T, I>(
iterator: I
) -> MutableUtf8Array<O> where
T: AsRef<str>,
I: Iterator<Item = T>,
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.
sourcepub fn from_trusted_len_values_iter<T, I>(iterator: I) -> MutableUtf8Array<O> where
T: AsRef<str>,
I: TrustedLen<Item = T>,
pub fn from_trusted_len_values_iter<T, I>(iterator: I) -> MutableUtf8Array<O> where
T: AsRef<str>,
I: TrustedLen<Item = T>,
Creates a new MutableUtf8Array
from a TrustedLen
of &str
.
sourcepub unsafe fn try_from_trusted_len_iter_unchecked<E, I, P>(
iterator: I
) -> Result<MutableUtf8Array<O>, E> where
P: AsRef<str>,
I: IntoIterator<Item = Result<Option<P>, E>>,
pub unsafe fn try_from_trusted_len_iter_unchecked<E, I, P>(
iterator: I
) -> Result<MutableUtf8Array<O>, E> where
P: AsRef<str>,
I: IntoIterator<Item = Result<Option<P>, E>>,
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.
sourcepub fn try_from_trusted_len_iter<E, I, P>(
iterator: I
) -> Result<MutableUtf8Array<O>, E> where
P: AsRef<str>,
I: TrustedLen<Item = Result<Option<P>, E>>,
pub fn try_from_trusted_len_iter<E, I, P>(
iterator: I
) -> Result<MutableUtf8Array<O>, E> where
P: AsRef<str>,
I: TrustedLen<Item = Result<Option<P>, E>>,
Creates a MutableUtf8Array
from an falible iterator of trusted length.
sourcepub fn from_iter_values<T, I>(iterator: I) -> MutableUtf8Array<O> where
T: AsRef<str>,
I: Iterator<Item = T>,
pub fn from_iter_values<T, I>(iterator: I) -> MutableUtf8Array<O> where
T: AsRef<str>,
I: Iterator<Item = T>,
Creates a new MutableUtf8Array
from a Iterator
of &str
.
Trait Implementations
sourceimpl<O> Debug for MutableUtf8Array<O> where
O: Debug + Offset,
impl<O> Debug for MutableUtf8Array<O> where
O: Debug + Offset,
sourceimpl<O> Default for MutableUtf8Array<O> where
O: Offset,
impl<O> Default for MutableUtf8Array<O> where
O: Offset,
sourcefn default() -> MutableUtf8Array<O>
fn default() -> MutableUtf8Array<O>
Returns the “default value” for a type. Read more
sourceimpl<O, T> Extend<Option<T>> for MutableUtf8Array<O> where
O: Offset,
T: AsRef<str>,
impl<O, T> Extend<Option<T>> for MutableUtf8Array<O> where
O: Offset,
T: AsRef<str>,
sourcefn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Option<T>>,
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Option<T>>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<O> From<MutableUtf8Array<O>> for Utf8Array<O> where
O: Offset,
impl<O> From<MutableUtf8Array<O>> for Utf8Array<O> where
O: Offset,
sourcefn from(other: MutableUtf8Array<O>) -> Utf8Array<O>
fn from(other: MutableUtf8Array<O>) -> Utf8Array<O>
Performs the conversion.
sourceimpl<O, P> FromIterator<Option<P>> for MutableUtf8Array<O> where
O: Offset,
P: AsRef<str>,
impl<O, P> FromIterator<Option<P>> for MutableUtf8Array<O> where
O: Offset,
P: AsRef<str>,
sourcefn from_iter<I>(iter: I) -> MutableUtf8Array<O> where
I: IntoIterator<Item = Option<P>>,
fn from_iter<I>(iter: I) -> MutableUtf8Array<O> where
I: IntoIterator<Item = Option<P>>,
Creates a value from an iterator. Read more
sourceimpl<O> MutableArray for MutableUtf8Array<O> where
O: Offset,
impl<O> MutableArray for MutableUtf8Array<O> where
O: Offset,
sourcefn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
The optional validity of the array.
sourcefn as_box(&mut self) -> Box<dyn Array + 'static, Global>
fn as_box(&mut self) -> Box<dyn Array + 'static, Global>
Convert itself to an (immutable) [‘Array’].
sourcefn as_arc(&mut self) -> Arc<dyn Array + 'static>
fn as_arc(&mut self) -> Arc<dyn Array + 'static>
Convert itself to an (immutable) atomically reference counted Array
.
sourcefn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
Convert to mutable Any
, to enable dynamic casting.
sourcefn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Shrink the array to fit its length.
sourceimpl<O, T> TryExtend<Option<T>> for MutableUtf8Array<O> where
O: Offset,
T: AsRef<str>,
impl<O, T> TryExtend<Option<T>> for MutableUtf8Array<O> where
O: Offset,
T: AsRef<str>,
sourcefn try_extend<I>(&mut self, iter: I) -> Result<(), ArrowError> where
I: IntoIterator<Item = Option<T>>,
fn try_extend<I>(&mut self, iter: I) -> Result<(), ArrowError> where
I: IntoIterator<Item = Option<T>>,
Fallible version of Extend::extend
.
Auto Trait Implementations
impl<O> RefUnwindSafe for MutableUtf8Array<O> where
O: RefUnwindSafe,
impl<O> Send for MutableUtf8Array<O>
impl<O> Sync for MutableUtf8Array<O>
impl<O> Unpin for MutableUtf8Array<O> where
O: Unpin,
impl<O> UnwindSafe for MutableUtf8Array<O> where
O: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more