pub trait DynVTable:
'static
+ Sealed
+ Send
+ Sync
+ Debug {
// Required methods
fn as_any(&self) -> &dyn Any;
fn id(&self) -> ArrayId;
fn build(
&self,
dtype: &DType,
len: usize,
metadata: &[u8],
buffers: &[BufferHandle],
children: &dyn ArrayChildren,
) -> VortexResult<ArrayRef>;
fn with_children(
&self,
array: &dyn Array,
children: &dyn ArrayChildren,
) -> VortexResult<ArrayRef>;
fn encode(
&self,
input: &Canonical,
like: Option<&dyn Array>,
) -> VortexResult<Option<ArrayRef>>;
}Expand description
Dynamically typed trait for invoking array vtables.
Required Methods§
Sourcefn build(
&self,
dtype: &DType,
len: usize,
metadata: &[u8],
buffers: &[BufferHandle],
children: &dyn ArrayChildren,
) -> VortexResult<ArrayRef>
fn build( &self, dtype: &DType, len: usize, metadata: &[u8], buffers: &[BufferHandle], children: &dyn ArrayChildren, ) -> VortexResult<ArrayRef>
Build an array from its parts.
fn with_children( &self, array: &dyn Array, children: &dyn ArrayChildren, ) -> VortexResult<ArrayRef>
Sourcefn encode(
&self,
input: &Canonical,
like: Option<&dyn Array>,
) -> VortexResult<Option<ArrayRef>>
fn encode( &self, input: &Canonical, like: Option<&dyn Array>, ) -> VortexResult<Option<ArrayRef>>
Encode the canonical array into this encoding implementation.
Returns None if this encoding does not support the given canonical array, for example
if the data type is incompatible.
Panics if like is encoded with a different encoding.