Struct ArrayAdapter

Source
pub struct ArrayAdapter<V: VTable>(/* private fields */);
Expand description

Adapter struct used to lift the VTable trait into an object-safe Array implementation.

Since this is a unit struct with repr(transparent), we are able to turn un-adapted array structs into [dyn Array] using some cheeky casting inside std::ops::Deref and AsRef. See the vtable! macro for more details.

Trait Implementations§

Source§

impl<V: VTable> Array for ArrayAdapter<V>

Source§

fn as_any(&self) -> &dyn Any

Returns the array as a reference to a generic Any trait object.
Source§

fn to_array(&self) -> ArrayRef

Returns the array as an ArrayRef.
Source§

fn len(&self) -> usize

Returns the length of the array.
Source§

fn dtype(&self) -> &DType

Returns the logical Vortex DType of the array.
Source§

fn encoding(&self) -> EncodingRef

Returns the encoding of the array.
Source§

fn encoding_id(&self) -> EncodingId

Returns the encoding ID of the array.
Source§

fn slice(&self, start: usize, stop: usize) -> VortexResult<ArrayRef>

Performs a constant-time slice of the array.
Source§

fn scalar_at(&self, index: usize) -> VortexResult<Scalar>

Fetch the scalar at the given index.
Source§

fn is_valid(&self, index: usize) -> VortexResult<bool>

Returns whether the item at index is valid.
Source§

fn is_invalid(&self, index: usize) -> VortexResult<bool>

Returns whether the item at index is invalid.
Source§

fn all_valid(&self) -> VortexResult<bool>

Returns whether all items in the array are valid. Read more
Source§

fn all_invalid(&self) -> VortexResult<bool>

Returns whether the array is all invalid. Read more
Source§

fn valid_count(&self) -> VortexResult<usize>

Returns the number of valid elements in the array.
Source§

fn invalid_count(&self) -> VortexResult<usize>

Returns the number of invalid elements in the array.
Source§

fn validity_mask(&self) -> VortexResult<Mask>

Returns the canonical validity mask for the array.
Source§

fn to_canonical(&self) -> VortexResult<Canonical>

Returns the canonical representation of the array.
Source§

fn append_to_builder(&self, builder: &mut dyn ArrayBuilder) -> VortexResult<()>

Writes the array into the canonical builder. Read more
Source§

fn statistics(&self) -> StatsSetRef<'_>

Returns the statistics of the array.
Source§

fn with_children(&self, children: &[ArrayRef]) -> VortexResult<ArrayRef>

Replaces the children of the array with the given array references.
Source§

fn invoke( &self, compute_fn: &ComputeFn, args: &InvocationArgs<'_>, ) -> VortexResult<Option<Output>>

Optionally invoke a kernel for the given compute function. Read more
Source§

fn is_empty(&self) -> bool

Returns whether the array is empty (has zero rows).
Source§

fn is_encoding(&self, encoding: EncodingId) -> bool

Returns whether the array is of the given encoding.
Source§

fn is_arrow(&self) -> bool

Returns whether this array is an arrow encoding.
Source§

fn is_canonical(&self) -> bool

Whether the array is of a canonical encoding.
Source§

impl<V: VTable> ArrayVisitor for ArrayAdapter<V>

Source§

fn children(&self) -> Vec<ArrayRef>

Returns the children of the array.
Source§

fn nchildren(&self) -> usize

Returns the number of children of the array.
Source§

fn children_names(&self) -> Vec<String>

Returns the names of the children of the array.
Source§

fn named_children(&self) -> Vec<(String, ArrayRef)>

Returns the array’s children with their names.
Source§

fn buffers(&self) -> Vec<ByteBuffer>

Returns the buffers of the array.
Source§

fn nbuffers(&self) -> usize

Returns the number of buffers of the array.
Source§

fn metadata(&self) -> VortexResult<Option<Vec<u8>>>

Returns the serialized metadata of the array, or None if the array does not support serialization.
Source§

fn metadata_fmt(&self, f: &mut Formatter<'_>) -> Result

Formats a human-readable metadata description.
Source§

impl<V: VTable> Debug for ArrayAdapter<V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<V> Freeze for ArrayAdapter<V>
where <V as VTable>::Array: Freeze,

§

impl<V> RefUnwindSafe for ArrayAdapter<V>
where <V as VTable>::Array: RefUnwindSafe,

§

impl<V> Send for ArrayAdapter<V>

§

impl<V> Sync for ArrayAdapter<V>

§

impl<V> Unpin for ArrayAdapter<V>
where <V as VTable>::Array: Unpin,

§

impl<V> UnwindSafe for ArrayAdapter<V>
where <V as VTable>::Array: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<A> ArrayVisitorExt for A
where A: Array + ?Sized,

Source§

fn nbuffers_recursive(&self) -> usize

Count the number of buffers encoded by self and all child arrays.
Source§

fn depth_first_traversal(&self) -> impl Iterator<Item = ArrayRef>

Depth-first traversal of the array and its children.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<A> ToCanonical for A
where A: Array + ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T