VTable

Trait VTable 

Source
pub trait VTable:
    'static
    + Sized
    + Send
    + Sync
    + Debug {
    type Expr: 'static + Send + Sync + Clone + Debug + DisplayAs + PartialEq + Eq + Hash + Deref<Target = dyn VortexExpr> + IntoExpr + AnalysisExpr;
    type Encoding: 'static + Send + Sync + Deref<Target = dyn ExprEncoding>;
    type Metadata: SerializeMetadata + DeserializeMetadata + Debug;

    // Required methods
    fn id(encoding: &Self::Encoding) -> ExprId;
    fn encoding(expr: &Self::Expr) -> ExprEncodingRef;
    fn metadata(expr: &Self::Expr) -> Option<Self::Metadata>;
    fn children(expr: &Self::Expr) -> Vec<&ExprRef> ;
    fn with_children(
        expr: &Self::Expr,
        children: Vec<ExprRef>,
    ) -> VortexResult<Self::Expr>;
    fn build(
        encoding: &Self::Encoding,
        metadata: &<Self::Metadata as DeserializeMetadata>::Output,
        children: Vec<ExprRef>,
    ) -> VortexResult<Self::Expr>;
    fn evaluate(expr: &Self::Expr, scope: &Scope) -> VortexResult<ArrayRef>;
    fn return_dtype(expr: &Self::Expr, scope: &DType) -> VortexResult<DType>;
}

Required Associated Types§

Required Methods§

Source

fn id(encoding: &Self::Encoding) -> ExprId

Returns the ID of the expr encoding.

Source

fn encoding(expr: &Self::Expr) -> ExprEncodingRef

Returns the encoding for the expr.

Source

fn metadata(expr: &Self::Expr) -> Option<Self::Metadata>

Returns the serialize-able metadata for the expr, or None if serialization is not supported.

Source

fn children(expr: &Self::Expr) -> Vec<&ExprRef>

Returns the children of the expr.

Source

fn with_children( expr: &Self::Expr, children: Vec<ExprRef>, ) -> VortexResult<Self::Expr>

Return a new instance of the expression with the children replaced.

§Preconditions

The number of children will match the current number of children in the expression.

Source

fn build( encoding: &Self::Encoding, metadata: &<Self::Metadata as DeserializeMetadata>::Output, children: Vec<ExprRef>, ) -> VortexResult<Self::Expr>

Construct a new VortexExpr from the provided parts.

Source

fn evaluate(expr: &Self::Expr, scope: &Scope) -> VortexResult<ArrayRef>

Evaluate the expression in the given scope.

Source

fn return_dtype(expr: &Self::Expr, scope: &DType) -> VortexResult<DType>

Compute the return DType of the expression if evaluated in the given scope.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl VTable for DynamicComparisonVTable

Source§

impl VTable for BetweenVTable

Source§

impl VTable for BinaryVTable

Source§

impl VTable for CastVTable

Source§

impl VTable for GetItemVTable

Source§

impl VTable for IsNullVTable

Source§

impl VTable for LikeVTable

Source§

impl VTable for ListContainsVTable

Source§

impl VTable for LiteralVTable

Source§

impl VTable for MergeVTable

Source§

impl VTable for NotVTable

Source§

impl VTable for PackVTable

Source§

impl VTable for RootVTable

Source§

impl VTable for SelectVTable