pub struct Array<V: VTable> { /* private fields */ }Expand description
A typed array, parameterized by a concrete VTable.
This struct holds the vtable instance, common fields (dtype, len, stats), and the
encoding-specific data (V::Array). It implements Deref to V::Array, so
encoding-specific methods are callable directly on &Array<V>.
Construct via encoding-specific constructors and type-erase with
into_array().
Implementations§
Source§impl<V: VTable> Array<V>
impl<V: VTable> Array<V>
Sourcepub unsafe fn new_unchecked(
vtable: V,
dtype: DType,
len: usize,
array: V::Array,
stats: ArrayStats,
) -> Self
pub unsafe fn new_unchecked( vtable: V, dtype: DType, len: usize, array: V::Array, stats: ArrayStats, ) -> Self
Create a new typed array without validating that the inner array’s dtype/len match.
§Safety
The caller must ensure that V::dtype(&array) == &dtype and V::len(&array) == len.
Sourcepub fn typed_vtable(&self) -> &V
pub fn typed_vtable(&self) -> &V
Returns a reference to the vtable.
Sourcepub fn encoding_id(&self) -> ArrayId
pub fn encoding_id(&self) -> ArrayId
Returns the encoding ID of this array.
Sourcepub fn statistics(&self) -> StatsSetRef<'_>
pub fn statistics(&self) -> StatsSetRef<'_>
Returns the statistics for this array.
Sourcepub fn array_stats(&self) -> &ArrayStats
pub fn array_stats(&self) -> &ArrayStats
Returns a reference to the underlying ArrayStats.
Sourcepub fn inner(&self) -> &V::Array
pub fn inner(&self) -> &V::Array
Returns a reference to the inner encoding-specific array data.
Sourcepub fn into_inner(self) -> V::Array
pub fn into_inner(self) -> V::Array
Consumes this array and returns the inner encoding-specific data.
Sourcepub fn to_array_ref(&self) -> ArrayRef
pub fn to_array_ref(&self) -> ArrayRef
Returns a cloned ArrayRef for this array.
Trait Implementations§
Source§impl<V: VTable> ArrayVisitor for Array<V>
impl<V: VTable> ArrayVisitor for Array<V>
Source§fn nth_child(&self, idx: usize) -> Option<ArrayRef>
fn nth_child(&self, idx: usize) -> Option<ArrayRef>
Source§fn children_names(&self) -> Vec<String>
fn children_names(&self) -> Vec<String>
Source§fn named_children(&self) -> Vec<(String, ArrayRef)>
fn named_children(&self) -> Vec<(String, ArrayRef)>
Source§fn buffer_handles(&self) -> Vec<BufferHandle>
fn buffer_handles(&self) -> Vec<BufferHandle>
Source§fn buffer_names(&self) -> Vec<String>
fn buffer_names(&self) -> Vec<String>
Source§fn named_buffers(&self) -> Vec<(String, BufferHandle)>
fn named_buffers(&self) -> Vec<(String, BufferHandle)>
Source§fn metadata(&self) -> VortexResult<Option<Vec<u8>>>
fn metadata(&self) -> VortexResult<Option<Vec<u8>>>
None if the array does not
support serialization.Source§fn metadata_fmt(&self, f: &mut Formatter<'_>) -> Result
fn metadata_fmt(&self, f: &mut Formatter<'_>) -> Result
Source§impl<V: VTable> DynArray for Array<V>
DynArray implementation for Array<V>.
impl<V: VTable> DynArray for Array<V>
DynArray implementation for Array<V>.
This is self-contained: identity methods use Array<V>’s own fields (dtype, len, stats),
while data-access methods delegate to VTable methods on the inner V::Array.
Source§fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>
fn as_any_arc(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>
Arc<dyn Any + Send + Sync>.Source§fn encoding_id(&self) -> ArrayId
fn encoding_id(&self) -> ArrayId
Source§fn slice(&self, range: Range<usize>) -> VortexResult<ArrayRef>
fn slice(&self, range: Range<usize>) -> VortexResult<ArrayRef>
Source§fn filter(&self, mask: Mask) -> VortexResult<ArrayRef>
fn filter(&self, mask: Mask) -> VortexResult<ArrayRef>
FilterArray such that it is logically filtered by the given mask.Source§fn take(&self, indices: ArrayRef) -> VortexResult<ArrayRef>
fn take(&self, indices: ArrayRef) -> VortexResult<ArrayRef>
DictArray such that it is logically taken by the given indices.Source§fn scalar_at(&self, index: usize) -> VortexResult<Scalar>
fn scalar_at(&self, index: usize) -> VortexResult<Scalar>
Source§fn is_valid(&self, index: usize) -> VortexResult<bool>
fn is_valid(&self, index: usize) -> VortexResult<bool>
index is valid.Source§fn is_invalid(&self, index: usize) -> VortexResult<bool>
fn is_invalid(&self, index: usize) -> VortexResult<bool>
index is invalid.Source§fn all_valid(&self) -> VortexResult<bool>
fn all_valid(&self) -> VortexResult<bool>
Source§fn all_invalid(&self) -> VortexResult<bool>
fn all_invalid(&self) -> VortexResult<bool>
Source§fn valid_count(&self) -> VortexResult<usize>
fn valid_count(&self) -> VortexResult<usize>
Source§fn invalid_count(&self) -> VortexResult<usize>
fn invalid_count(&self) -> VortexResult<usize>
Source§fn validity_mask(&self) -> VortexResult<Mask>
fn validity_mask(&self) -> VortexResult<Mask>
Source§fn to_canonical(&self) -> VortexResult<Canonical>
fn to_canonical(&self) -> VortexResult<Canonical>
Source§fn append_to_builder(
&self,
builder: &mut dyn ArrayBuilder,
ctx: &mut ExecutionCtx,
) -> VortexResult<()>
fn append_to_builder( &self, builder: &mut dyn ArrayBuilder, ctx: &mut ExecutionCtx, ) -> VortexResult<()>
Source§fn statistics(&self) -> StatsSetRef<'_>
fn statistics(&self) -> StatsSetRef<'_>
Source§fn with_children(&self, children: Vec<ArrayRef>) -> VortexResult<ArrayRef>
fn with_children(&self, children: Vec<ArrayRef>) -> VortexResult<ArrayRef>
Source§impl<V: VTable> ReduceNode for Array<V>
impl<V: VTable> ReduceNode for Array<V>
Source§fn node_dtype(&self) -> VortexResult<DType>
fn node_dtype(&self) -> VortexResult<DType>
Source§fn scalar_fn(&self) -> Option<&ScalarFnRef>
fn scalar_fn(&self) -> Option<&ScalarFnRef>
Source§fn child(&self, idx: usize) -> ReduceNodeRef
fn child(&self, idx: usize) -> ReduceNodeRef
Source§fn child_count(&self) -> usize
fn child_count(&self) -> usize
Auto Trait Implementations§
impl<V> Freeze for Array<V>
impl<V> !RefUnwindSafe for Array<V>
impl<V> Send for Array<V>
impl<V> Sync for Array<V>
impl<V> Unpin for Array<V>
impl<V> UnsafeUnpin for Array<V>
impl<V> !UnwindSafe for Array<V>
Blanket Implementations§
Source§impl<A> ArrayVisitorExt for A
impl<A> ArrayVisitorExt for A
Source§fn nbuffers_recursive(&self) -> usize
fn nbuffers_recursive(&self) -> usize
Source§fn depth_first_traversal(&self) -> impl Iterator<Item = ArrayRef>
fn depth_first_traversal(&self) -> impl Iterator<Item = ArrayRef>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynArrayEq for Twhere
T: ArrayEq + 'static,
impl<T> DynArrayEq for Twhere
T: ArrayEq + 'static,
Source§impl<T> DynArrayHash for T
impl<T> DynArrayHash for T
fn dyn_array_hash(&self, state: &mut dyn Hasher, precision: Precision)
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> SessionVar for T
impl<T> SessionVar for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<A> ToCanonical for A
impl<A> ToCanonical for A
Source§fn to_primitive(&self) -> PrimitiveArray
fn to_primitive(&self) -> PrimitiveArray
PrimitiveArray if the target is Primitive
typed.Source§fn to_decimal(&self) -> DecimalArray
fn to_decimal(&self) -> DecimalArray
DecimalArray if the target is Decimal
typed.Source§fn to_struct(&self) -> StructArray
fn to_struct(&self) -> StructArray
StructArray if the target is Struct typed.Source§fn to_listview(&self) -> ListViewArray
fn to_listview(&self) -> ListViewArray
ListViewArray if the target is List typed.Source§fn to_fixed_size_list(&self) -> FixedSizeListArray
fn to_fixed_size_list(&self) -> FixedSizeListArray
FixedSizeListArray if the target is List
typed.Source§fn to_varbinview(&self) -> VarBinViewArray
fn to_varbinview(&self) -> VarBinViewArray
Source§fn to_extension(&self) -> ExtensionArray
fn to_extension(&self) -> ExtensionArray
ExtensionArray if the array is Extension
typed.