Struct vortex::array::PrimitiveArray
pub struct PrimitiveArray(/* private fields */);
Implementations§
§impl PrimitiveArray
impl PrimitiveArray
pub fn patch(self, patches: Patches) -> Result<PrimitiveArray, VortexError>
§impl PrimitiveArray
impl PrimitiveArray
pub fn maybe_from(data: impl AsRef<ArrayData>) -> Option<PrimitiveArray>
pub fn maybe_from(data: impl AsRef<ArrayData>) -> Option<PrimitiveArray>
Optionally downcast an ArrayData
instance to a specific encoding.
Preferred in cases where a backtrace isn’t needed, like when trying multiple encoding to go down different code paths.
§impl PrimitiveArray
impl PrimitiveArray
pub fn new(buffer: Buffer, ptype: PType, validity: Validity) -> PrimitiveArray
pub fn from_vec<T>(values: Vec<T>, validity: Validity) -> PrimitiveArraywhere
T: NativePType,
pub fn from_nullable_vec<T>(values: Vec<Option<T>>) -> PrimitiveArraywhere
T: NativePType,
pub fn validity(&self) -> Validity
pub fn buffer(&self) -> &Buffer
pub fn maybe_null_slice<T>(&self) -> &[T]where
T: NativePType,
pub fn into_maybe_null_slice<T>(self) -> Vec<T>where
T: NativePType + ArrowNativeType,
pub fn into_maybe_null_slice<T>(self) -> Vec<T>where
T: NativePType + ArrowNativeType,
Convert the array into a mutable vec of the given type. If possible, this will be zero-copy.
pub fn get_as_cast<T>(&self, idx: usize) -> Twhere
T: NativePType,
pub fn reinterpret_cast(&self, ptype: PType) -> PrimitiveArray
pub fn into_buffer(self) -> Buffer
Trait Implementations§
§impl<T> Accessor<T> for PrimitiveArraywhere
T: NativePType,
impl<T> Accessor<T> for PrimitiveArraywhere
T: NativePType,
§impl<T> ArrayAccessor<T> for PrimitiveArraywhere
T: NativePType,
impl<T> ArrayAccessor<T> for PrimitiveArraywhere
T: NativePType,
§impl AsRef<ArrayData> for PrimitiveArray
impl AsRef<ArrayData> for PrimitiveArray
§impl CastFn<PrimitiveArray> for PrimitiveEncoding
impl CastFn<PrimitiveArray> for PrimitiveEncoding
fn cast( &self, array: &PrimitiveArray, dtype: &DType, ) -> Result<ArrayData, VortexError>
§impl Clone for PrimitiveArray
impl Clone for PrimitiveArray
§fn clone(&self) -> PrimitiveArray
fn clone(&self) -> PrimitiveArray
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for PrimitiveArray
impl Debug for PrimitiveArray
§impl FillForwardFn<PrimitiveArray> for PrimitiveEncoding
impl FillForwardFn<PrimitiveArray> for PrimitiveEncoding
fn fill_forward(&self, array: &PrimitiveArray) -> Result<ArrayData, VortexError>
§impl FilterFn<PrimitiveArray> for PrimitiveEncoding
impl FilterFn<PrimitiveArray> for PrimitiveEncoding
§fn filter(
&self,
array: &PrimitiveArray,
mask: FilterMask,
) -> Result<ArrayData, VortexError>
fn filter( &self, array: &PrimitiveArray, mask: FilterMask, ) -> Result<ArrayData, VortexError>
Filter an array by the provided predicate.
§impl<T> From<Vec<T>> for PrimitiveArraywhere
T: NativePType,
impl<T> From<Vec<T>> for PrimitiveArraywhere
T: NativePType,
§fn from(values: Vec<T>) -> PrimitiveArray
fn from(values: Vec<T>) -> PrimitiveArray
Converts to this type from the input type.
§impl<T> FromIterator<Option<T>> for PrimitiveArraywhere
T: NativePType,
impl<T> FromIterator<Option<T>> for PrimitiveArraywhere
T: NativePType,
§fn from_iter<I>(iter: I) -> PrimitiveArraywhere
I: IntoIterator<Item = Option<T>>,
fn from_iter<I>(iter: I) -> PrimitiveArraywhere
I: IntoIterator<Item = Option<T>>,
Creates a value from an iterator. Read more
§impl IntoArrayData for PrimitiveArray
impl IntoArrayData for PrimitiveArray
fn into_array(self) -> ArrayData
§impl IntoCanonical for PrimitiveArray
impl IntoCanonical for PrimitiveArray
fn into_canonical(self) -> Result<Canonical, VortexError>
fn into_arrow(self) -> Result<Arc<dyn Array>, VortexError>where
Self: Sized,
§impl PrimitiveArrayTrait for PrimitiveArray
impl PrimitiveArrayTrait for PrimitiveArray
§impl ScalarAtFn<PrimitiveArray> for PrimitiveEncoding
impl ScalarAtFn<PrimitiveArray> for PrimitiveEncoding
fn scalar_at( &self, array: &PrimitiveArray, index: usize, ) -> Result<Scalar, VortexError>
§impl SearchSortedFn<PrimitiveArray> for PrimitiveEncoding
impl SearchSortedFn<PrimitiveArray> for PrimitiveEncoding
fn search_sorted( &self, array: &PrimitiveArray, value: &Scalar, side: SearchSortedSide, ) -> Result<SearchResult, VortexError>
§fn search_sorted_many(
&self,
array: &Array,
values: &[Scalar],
side: SearchSortedSide,
) -> Result<Vec<SearchResult>, VortexError>
fn search_sorted_many( &self, array: &Array, values: &[Scalar], side: SearchSortedSide, ) -> Result<Vec<SearchResult>, VortexError>
Bulk search for many values.
§impl SearchSortedUsizeFn<PrimitiveArray> for PrimitiveEncoding
impl SearchSortedUsizeFn<PrimitiveArray> for PrimitiveEncoding
fn search_sorted_usize( &self, array: &PrimitiveArray, value: usize, side: SearchSortedSide, ) -> Result<SearchResult, VortexError>
fn search_sorted_usize_many( &self, array: &Array, values: &[usize], side: SearchSortedSide, ) -> Result<Vec<SearchResult>, VortexError>
§impl SliceFn<PrimitiveArray> for PrimitiveEncoding
impl SliceFn<PrimitiveArray> for PrimitiveEncoding
§fn slice(
&self,
array: &PrimitiveArray,
start: usize,
stop: usize,
) -> Result<ArrayData, VortexError>
fn slice( &self, array: &PrimitiveArray, start: usize, stop: usize, ) -> Result<ArrayData, VortexError>
Return a zero-copy slice of an array, between
start
(inclusive) and end
(exclusive).
If start >= stop, returns an empty array of the same type as self
.
Assumes that start or stop are out of bounds, may panic otherwise.§impl StatisticsVTable<PrimitiveArray> for PrimitiveEncoding
impl StatisticsVTable<PrimitiveArray> for PrimitiveEncoding
§fn compute_statistics(
&self,
array: &PrimitiveArray,
stat: Stat,
) -> Result<StatsSet, VortexError>
fn compute_statistics( &self, array: &PrimitiveArray, stat: Stat, ) -> Result<StatsSet, VortexError>
Compute the requested statistic. Can return additional stats.
§impl TakeFn<PrimitiveArray> for PrimitiveEncoding
impl TakeFn<PrimitiveArray> for PrimitiveEncoding
§unsafe fn take_unchecked(
&self,
array: &PrimitiveArray,
indices: &ArrayData,
) -> Result<ArrayData, VortexError>
unsafe fn take_unchecked( &self, array: &PrimitiveArray, indices: &ArrayData, ) -> Result<ArrayData, VortexError>
§impl<'a> TryFrom<&'a ArrayData> for &'a PrimitiveArray
impl<'a> TryFrom<&'a ArrayData> for &'a PrimitiveArray
§impl TryFrom<ArrayData> for PrimitiveArray
impl TryFrom<ArrayData> for PrimitiveArray
§impl ValidityVTable<PrimitiveArray> for PrimitiveEncoding
impl ValidityVTable<PrimitiveArray> for PrimitiveEncoding
fn is_valid(&self, array: &PrimitiveArray, index: usize) -> bool
fn logical_validity(&self, array: &PrimitiveArray) -> LogicalValidity
§impl VariantsVTable<PrimitiveArray> for PrimitiveEncoding
impl VariantsVTable<PrimitiveArray> for PrimitiveEncoding
fn as_primitive_array<'a>( &self, array: &'a PrimitiveArray, ) -> Option<&'a dyn PrimitiveArrayTrait>
fn as_null_array<'a>(&self, _array: &'a Array) -> Option<&'a dyn NullArrayTrait>
fn as_bool_array<'a>(&self, _array: &'a Array) -> Option<&'a dyn BoolArrayTrait>
fn as_utf8_array<'a>(&self, _array: &'a Array) -> Option<&'a dyn Utf8ArrayTrait>
fn as_binary_array<'a>( &self, _array: &'a Array, ) -> Option<&'a dyn BinaryArrayTrait>
fn as_struct_array<'a>( &self, _array: &'a Array, ) -> Option<&'a dyn StructArrayTrait>
fn as_list_array<'a>(&self, _array: &'a Array) -> Option<&'a dyn ListArrayTrait>
fn as_extension_array<'a>( &self, _array: &'a Array, ) -> Option<&'a dyn ExtensionArrayTrait>
§impl VisitorVTable<PrimitiveArray> for PrimitiveEncoding
impl VisitorVTable<PrimitiveArray> for PrimitiveEncoding
fn accept( &self, array: &PrimitiveArray, visitor: &mut dyn ArrayVisitor, ) -> Result<(), VortexError>
impl ArrayTrait for PrimitiveArray
Auto Trait Implementations§
impl !Freeze for PrimitiveArray
impl !RefUnwindSafe for PrimitiveArray
impl Send for PrimitiveArray
impl Sync for PrimitiveArray
impl Unpin for PrimitiveArray
impl !UnwindSafe for PrimitiveArray
Blanket Implementations§
§impl<T> ArrayEncodingRef for T
impl<T> ArrayEncodingRef for T
fn encoding(&self) -> &'static dyn EncodingVTable
§impl<A> ArrayNBytes for A
impl<A> ArrayNBytes for A
§impl<T> ArrayStatistics for T
impl<T> ArrayStatistics for T
fn statistics(&self) -> &dyn Statistics
fn inherit_statistics(&self, parent: &dyn Statistics)
§impl<A> ArrayValidity for A
impl<A> ArrayValidity for A
§fn is_valid(&self, index: usize) -> bool
fn is_valid(&self, index: usize) -> bool
Return whether the element at the given index is valid (true) or null (false).
§fn logical_validity(&self) -> LogicalValidity
fn logical_validity(&self) -> LogicalValidity
Return the logical validity of the array.
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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>
§impl<T> IntoArrayVariant for Twhere
T: IntoCanonical,
impl<T> IntoArrayVariant for Twhere
T: IntoCanonical,
fn into_null(self) -> Result<NullArray, VortexError>
fn into_bool(self) -> Result<BoolArray, VortexError>
fn into_primitive(self) -> Result<PrimitiveArray, VortexError>
fn into_struct(self) -> Result<StructArray, VortexError>
fn into_list(self) -> Result<ListArray, VortexError>
fn into_varbinview(self) -> Result<VarBinViewArray, VortexError>
fn into_extension(self) -> Result<ExtensionArray, VortexError>
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>
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 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>
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