Struct re_sdk::external::arrow2::array::MutableUtf8ValuesArray
pub struct MutableUtf8ValuesArray<O>where
O: Offset,{
data_type: DataType,
offsets: Offsets<O>,
values: Vec<u8>,
}
Expand description
A MutableArray
that builds a Utf8Array
. It differs
from MutableUtf8Array
in that it builds non-null Utf8Array
.
Fields§
§data_type: DataType
§offsets: Offsets<O>
§values: Vec<u8>
Implementations§
§impl<O> MutableUtf8ValuesArray<O>where
O: Offset,
impl<O> MutableUtf8ValuesArray<O>where
O: Offset,
pub fn new() -> MutableUtf8ValuesArray<O>
pub fn new() -> MutableUtf8ValuesArray<O>
Returns an empty MutableUtf8ValuesArray
.
pub fn try_new(
data_type: DataType,
offsets: Offsets<O>,
values: Vec<u8>
) -> Result<MutableUtf8ValuesArray<O>, Error>
pub fn try_new( data_type: DataType, offsets: Offsets<O>, values: Vec<u8> ) -> Result<MutableUtf8ValuesArray<O>, Error>
Returns a MutableUtf8ValuesArray
created from its internal representation.
§Errors
This function returns an error iff:
- The last offset is not equal to the values’ length.
- The
data_type
’scrate::datatypes::PhysicalType
is not equal to eitherUtf8
orLargeUtf8
. - The
values
between two consecutiveoffsets
are not valid utf8
§Implementation
This function is O(N)
- checking utf8 is O(N)
pub unsafe fn new_unchecked(
data_type: DataType,
offsets: Offsets<O>,
values: Vec<u8>
) -> MutableUtf8ValuesArray<O>
pub unsafe fn new_unchecked( data_type: DataType, offsets: Offsets<O>, values: Vec<u8> ) -> MutableUtf8ValuesArray<O>
Returns a MutableUtf8ValuesArray
created from its internal representation.
§Panic
This function does not panic iff:
- The last offset is equal to the values’ length.
- The
data_type
’scrate::datatypes::PhysicalType
is equal to eitherUtf8
orLargeUtf8
.
§Safety
This function is safe iff:
- the offsets are monotonically increasing
- The
values
between two consecutiveoffsets
are not valid utf8
§Implementation
This function is O(1)
pub fn default_data_type() -> DataType
pub fn default_data_type() -> DataType
Returns the default DataType
of this container: DataType::Utf8
or DataType::LargeUtf8
depending on the generic Offset
.
pub fn with_capacity(capacity: usize) -> MutableUtf8ValuesArray<O>
pub fn with_capacity(capacity: usize) -> MutableUtf8ValuesArray<O>
Initializes a new MutableUtf8ValuesArray
with a pre-allocated capacity of items.
pub fn with_capacities(
capacity: usize,
values: usize
) -> MutableUtf8ValuesArray<O>
pub fn with_capacities( capacity: usize, values: usize ) -> MutableUtf8ValuesArray<O>
Initializes a new MutableUtf8ValuesArray
with a pre-allocated capacity of items and values.
pub 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.
pub fn push<T>(&mut self, value: T)
pub fn push<T>(&mut self, value: T)
Pushes a new item to the array.
§Panic
This operation panics iff the length of all values (in bytes) exceeds O
maximum value.
pub fn pop(&mut self) -> Option<String>
pub fn pop(&mut self) -> Option<String>
Pop the last entry from MutableUtf8ValuesArray
.
This function returns None
iff this array is empty.
pub unsafe fn value_unchecked(&self, i: usize) -> &str
pub unsafe fn value_unchecked(&self, i: usize) -> &str
pub fn iter(&self) -> ArrayValuesIter<'_, MutableUtf8ValuesArray<O>> ⓘ
pub fn iter(&self) -> ArrayValuesIter<'_, MutableUtf8ValuesArray<O>> ⓘ
Returns an iterator of &str
pub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the MutableUtf8ValuesArray
to fit its current length.
pub fn into_inner(self) -> (DataType, Offsets<O>, Vec<u8>)
pub fn into_inner(self) -> (DataType, Offsets<O>, Vec<u8>)
Extract the low-end APIs from the MutableUtf8ValuesArray
.
§impl<O> MutableUtf8ValuesArray<O>where
O: Offset,
impl<O> MutableUtf8ValuesArray<O>where
O: Offset,
pub fn extend_trusted_len<I, P>(&mut self, iterator: I)
pub fn extend_trusted_len<I, P>(&mut self, iterator: I)
Extends the MutableUtf8ValuesArray
from a TrustedLen
pub unsafe fn extend_trusted_len_unchecked<I, P>(&mut self, iterator: I)
pub unsafe fn extend_trusted_len_unchecked<I, P>(&mut self, iterator: I)
Extends MutableUtf8ValuesArray
from an iterator of trusted len.
§Safety
The iterator must be trusted len.
pub fn from_trusted_len_iter<I, P>(iterator: I) -> MutableUtf8ValuesArray<O>
pub fn from_trusted_len_iter<I, P>(iterator: I) -> MutableUtf8ValuesArray<O>
Creates a MutableUtf8ValuesArray
from a TrustedLen
pub unsafe fn from_trusted_len_iter_unchecked<I, P>(
iterator: I
) -> MutableUtf8ValuesArray<O>
pub unsafe fn from_trusted_len_iter_unchecked<I, P>( iterator: I ) -> MutableUtf8ValuesArray<O>
Returns a new MutableUtf8ValuesArray
from an iterator of trusted length.
§Safety
The iterator must be TrustedLen
.
I.e. that size_hint().1
correctly reports its length.
pub fn try_from_iter<P, I>(iter: I) -> Result<MutableUtf8ValuesArray<O>, Error>
pub fn try_from_iter<P, I>(iter: I) -> Result<MutableUtf8ValuesArray<O>, Error>
Returns a new MutableUtf8ValuesArray
from an iterator.
§Error
This operation errors iff the total length in bytes on the iterator exceeds O
’s maximum value.
(i32::MAX
or i64::MAX
respectively).
pub fn extend_fallible<T, I, E>(&mut self, iter: I) -> Result<(), E>
pub fn extend_fallible<T, I, E>(&mut self, iter: I) -> Result<(), E>
Extend with a fallible iterator
Trait Implementations§
§impl<O> Clone for MutableUtf8ValuesArray<O>
impl<O> Clone for MutableUtf8ValuesArray<O>
§fn clone(&self) -> MutableUtf8ValuesArray<O>
fn clone(&self) -> MutableUtf8ValuesArray<O>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<O> Debug for MutableUtf8ValuesArray<O>
impl<O> Debug for MutableUtf8ValuesArray<O>
§impl<O> Default for MutableUtf8ValuesArray<O>where
O: Offset,
impl<O> Default for MutableUtf8ValuesArray<O>where
O: Offset,
§fn default() -> MutableUtf8ValuesArray<O>
fn default() -> MutableUtf8ValuesArray<O>
§impl<O, T> Extend<T> for MutableUtf8ValuesArray<O>
impl<O, T> Extend<T> for MutableUtf8ValuesArray<O>
§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)§impl<O> From<MutableUtf8ValuesArray<O>> for MutableUtf8Array<O>where
O: Offset,
impl<O> From<MutableUtf8ValuesArray<O>> for MutableUtf8Array<O>where
O: Offset,
§fn from(other: MutableUtf8ValuesArray<O>) -> MutableUtf8Array<O>
fn from(other: MutableUtf8ValuesArray<O>) -> MutableUtf8Array<O>
§impl<O> From<MutableUtf8ValuesArray<O>> for Utf8Array<O>where
O: Offset,
impl<O> From<MutableUtf8ValuesArray<O>> for Utf8Array<O>where
O: Offset,
§fn from(other: MutableUtf8ValuesArray<O>) -> Utf8Array<O>
fn from(other: MutableUtf8ValuesArray<O>) -> Utf8Array<O>
§impl<O, P> FromIterator<P> for MutableUtf8ValuesArray<O>
impl<O, P> FromIterator<P> for MutableUtf8ValuesArray<O>
§fn from_iter<I>(iter: I) -> MutableUtf8ValuesArray<O>where
I: IntoIterator<Item = P>,
fn from_iter<I>(iter: I) -> MutableUtf8ValuesArray<O>where
I: IntoIterator<Item = P>,
§impl<'a, O> IntoIterator for &'a MutableUtf8ValuesArray<O>where
O: Offset,
impl<'a, O> IntoIterator for &'a MutableUtf8ValuesArray<O>where
O: Offset,
§type IntoIter = ArrayValuesIter<'a, MutableUtf8ValuesArray<O>>
type IntoIter = ArrayValuesIter<'a, MutableUtf8ValuesArray<O>>
§fn into_iter(self) -> <&'a MutableUtf8ValuesArray<O> as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a MutableUtf8ValuesArray<O> as IntoIterator>::IntoIter
§impl<O> MutableArray for MutableUtf8ValuesArray<O>where
O: Offset,
impl<O> MutableArray for MutableUtf8ValuesArray<O>where
O: Offset,
§fn validity(&self) -> Option<&MutableBitmap>
fn validity(&self) -> Option<&MutableBitmap>
§fn as_arc(&mut self) -> Arc<dyn Array>
fn as_arc(&mut self) -> Arc<dyn Array>
Array
.§fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
Any
, to enable dynamic casting.§fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
§impl<O, T> TryExtend<T> for MutableUtf8ValuesArray<O>
impl<O, T> TryExtend<T> for MutableUtf8ValuesArray<O>
§fn try_extend<I>(&mut self, iter: I) -> Result<(), Error>where
I: IntoIterator<Item = T>,
fn try_extend<I>(&mut self, iter: I) -> Result<(), Error>where
I: IntoIterator<Item = T>,
Extend::extend
.§impl<O> TryExtendFromSelf for MutableUtf8ValuesArray<O>where
O: Offset,
impl<O> TryExtendFromSelf for MutableUtf8ValuesArray<O>where
O: Offset,
§fn try_extend_from_self(
&mut self,
other: &MutableUtf8ValuesArray<O>
) -> Result<(), Error>
fn try_extend_from_self( &mut self, other: &MutableUtf8ValuesArray<O> ) -> Result<(), Error>
other
, failing only on overflow.Auto Trait Implementations§
impl<O> Freeze for MutableUtf8ValuesArray<O>
impl<O> RefUnwindSafe for MutableUtf8ValuesArray<O>
impl<O> Send for MutableUtf8ValuesArray<O>
impl<O> Sync for MutableUtf8ValuesArray<O>
impl<O> Unpin for MutableUtf8ValuesArray<O>where
O: Unpin,
impl<O> UnwindSafe for MutableUtf8ValuesArray<O>where
O: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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