pub trait OperationsVTable<V: VTable> {
type ProbeState: Default + 'static;
// Required method
fn scalar_at(
array: ArrayView<'_, V>,
index: usize,
ctx: &mut ExecutionCtx,
) -> VortexResult<Scalar>;
// Provided method
fn probe_scalar(
state: &mut ProbeState<'_, V>,
index: usize,
ctx: &mut ExecutionCtx,
) -> VortexResult<Scalar> { ... }
}Expand description
Required Associated Types§
Sourcetype ProbeState: Default + 'static
type ProbeState: Default + 'static
Encoding-specific state retained by repeated scalar access.
Built once per repeated probe and never for a one-off read. Preparation belongs in
Self::probe_scalar. State owns its preparation and may hold shared buffer or array
handles. Use () when no state is needed.
Required Methods§
Sourcefn scalar_at(
array: ArrayView<'_, V>,
index: usize,
ctx: &mut ExecutionCtx,
) -> VortexResult<Scalar>
fn scalar_at( array: ArrayView<'_, V>, index: usize, ctx: &mut ExecutionCtx, ) -> VortexResult<Scalar>
Fetch the scalar at the given index.
§Preconditions
Bounds-checking has already been performed by the time this function is called,
and the index is guaranteed to be non-null. Implementations may assume index < len.
§Postconditions
The returned Scalar must have the same logical dtype as the array’s element dtype.
Provided Methods§
Sourcefn probe_scalar(
state: &mut ProbeState<'_, V>,
index: usize,
ctx: &mut ExecutionCtx,
) -> VortexResult<Scalar>
fn probe_scalar( state: &mut ProbeState<'_, V>, index: usize, ctx: &mut ExecutionCtx, ) -> VortexResult<Scalar>
Read the scalar at index of the array in state, including its nullness.
Caller must guarantee index < len. The row may be null, and a null row must come back
as Scalar::null of the array’s dtype. Check the array’s own validity with
ProbeState::is_valid.
state carries the typed view of the array and, for a read through a
RepeatedArrayProbe, the state that probe keeps. Read
children through ProbeState::slot, which follows the read’s policy without the
encoding having to know it. Take encoding state from ProbeState::retained. The scalar
must retain the source’s logical dtype, including nullability.
The default checks validity and then reads through Self::scalar_at.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".