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§
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§
Sourcefn encoding(expr: &Self::Expr) -> ExprEncodingRef
fn encoding(expr: &Self::Expr) -> ExprEncodingRef
Returns the encoding for the expr.
Sourcefn metadata(expr: &Self::Expr) -> Option<Self::Metadata>
fn metadata(expr: &Self::Expr) -> Option<Self::Metadata>
Returns the serialize-able metadata for the expr, or None
if serialization is not
supported.
Sourcefn with_children(
expr: &Self::Expr,
children: Vec<ExprRef>,
) -> VortexResult<Self::Expr>
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.
Sourcefn build(
encoding: &Self::Encoding,
metadata: &<Self::Metadata as DeserializeMetadata>::Output,
children: Vec<ExprRef>,
) -> VortexResult<Self::Expr>
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.
Sourcefn evaluate(expr: &Self::Expr, scope: &Scope) -> VortexResult<ArrayRef>
fn evaluate(expr: &Self::Expr, scope: &Scope) -> VortexResult<ArrayRef>
Evaluate the expression in the given scope.
Sourcefn return_dtype(expr: &Self::Expr, scope: &DType) -> VortexResult<DType>
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.