DynVTable

Trait DynVTable 

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

Source

fn as_any(&self) -> &dyn Any

Downcast the encoding to Any.

Source

fn id(&self) -> ArrayId

Returns the ID of the encoding.

Source

fn build( &self, dtype: &DType, len: usize, metadata: &[u8], buffers: &[BufferHandle], children: &dyn ArrayChildren, ) -> VortexResult<ArrayRef>

Build an array from its parts.

Source

fn with_children( &self, array: &dyn Array, children: &dyn ArrayChildren, ) -> VortexResult<ArrayRef>

Source

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.

Implementations§

Source§

impl dyn DynVTable + '_

Source

pub fn as_<V: VTable>(&self) -> &V

Trait Implementations§

Source§

impl Display for dyn DynVTable + '_

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for dyn DynVTable + '_

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for dyn DynVTable + '_

Implementors§