pub trait DatasetExprExt {
// Required methods
fn validate_real_expressions(
&self,
expressions: &[Expr],
execution: &Execution,
) -> RuntimeResult<()>;
fn evaluate_expr(
&self,
expr: &Expr,
execution: &Execution,
) -> RuntimeResult<Vec<Complex64>>;
fn evaluate_real(
&self,
expr: &Expr,
execution: &Execution,
) -> RuntimeResult<Vec<f64>>;
fn visit_real_chunks(
&self,
expressions: &[Expr],
execution: &Execution,
chunk_size: usize,
consume: impl FnMut(usize, &[Vec<f64>]) -> RuntimeResult<()>,
) -> RuntimeResult<()>;
fn histogram(
&self,
expr: &Expr,
bins: BinSpec,
event_weights: bool,
weight: Option<&Expr>,
execution: &Execution,
) -> RuntimeResult<Histogram>;
fn joint_histogram(
&self,
axes: &[Expr],
bins: Vec<BinSpec>,
event_weights: bool,
weight: Option<&Expr>,
execution: &Execution,
) -> RuntimeResult<JointHistogram>;
fn select(
&self,
predicate: &Predicate,
execution: &Execution,
) -> RuntimeResult<Dataset>;
fn bin_by(
&self,
expr: &Expr,
bins: BinSpec,
execution: &Execution,
) -> RuntimeResult<Vec<DatasetBin>>;
}Expand description
Expression-based query operations for datasets.
Required Methods§
Sourcefn validate_real_expressions(
&self,
expressions: &[Expr],
execution: &Execution,
) -> RuntimeResult<()>
fn validate_real_expressions( &self, expressions: &[Expr], execution: &Execution, ) -> RuntimeResult<()>
Validates real scalar query expressions without reading dataset events.
§Errors
Returns an error for empty, parameter-dependent, or non-real expressions, or preparation failure.
Sourcefn evaluate_expr(
&self,
expr: &Expr,
execution: &Execution,
) -> RuntimeResult<Vec<Complex64>>
fn evaluate_expr( &self, expr: &Expr, execution: &Execution, ) -> RuntimeResult<Vec<Complex64>>
Evaluates a scalar expression for every event.
§Errors
Returns RuntimeError when compilation, dataset reading, or
evaluation fails, or the expression is not scalar.
Sourcefn evaluate_real(
&self,
expr: &Expr,
execution: &Execution,
) -> RuntimeResult<Vec<f64>>
fn evaluate_real( &self, expr: &Expr, execution: &Execution, ) -> RuntimeResult<Vec<f64>>
Evaluates a real scalar expression for every event.
§Errors
Returns RuntimeError when compilation, dataset reading, or
evaluation fails, or the expression is not real scalar-valued.
Sourcefn visit_real_chunks(
&self,
expressions: &[Expr],
execution: &Execution,
chunk_size: usize,
consume: impl FnMut(usize, &[Vec<f64>]) -> RuntimeResult<()>,
) -> RuntimeResult<()>
fn visit_real_chunks( &self, expressions: &[Expr], execution: &Execution, chunk_size: usize, consume: impl FnMut(usize, &[Vec<f64>]) -> RuntimeResult<()>, ) -> RuntimeResult<()>
Visits real scalar expression values in bounded event chunks. The offset is the first event’s global row number and expressions retain their requested order within each callback.
§Errors
Returns an error for zero chunk size, invalid expressions, dataset access, evaluation, or a callback failure.
Sourcefn histogram(
&self,
expr: &Expr,
bins: BinSpec,
event_weights: bool,
weight: Option<&Expr>,
execution: &Execution,
) -> RuntimeResult<Histogram>
fn histogram( &self, expr: &Expr, bins: BinSpec, event_weights: bool, weight: Option<&Expr>, execution: &Execution, ) -> RuntimeResult<Histogram>
Evaluates and fills one weighted histogram in a bounded dataset traversal.
Dataset event weights are used when event_weights is true. When
weight is supplied, its real scalar value multiplies the selected
event weight (or unit weight when event weights are disabled).
§Errors
Returns RuntimeError when bin validation, expression preparation,
dataset reading, evaluation, or histogram filling fails.
Sourcefn joint_histogram(
&self,
axes: &[Expr],
bins: Vec<BinSpec>,
event_weights: bool,
weight: Option<&Expr>,
execution: &Execution,
) -> RuntimeResult<JointHistogram>
fn joint_histogram( &self, axes: &[Expr], bins: Vec<BinSpec>, event_weights: bool, weight: Option<&Expr>, execution: &Execution, ) -> RuntimeResult<JointHistogram>
Evaluates ordered scalar axes and fills one bounded row-major joint histogram.
§Errors
Returns RuntimeError for missing or mismatched axes, invalid edges,
non-scalar expressions, evaluation failures, or source read failures.
Sourcefn select(
&self,
predicate: &Predicate,
execution: &Execution,
) -> RuntimeResult<Dataset>
fn select( &self, predicate: &Predicate, execution: &Execution, ) -> RuntimeResult<Dataset>
Creates a lazily filtered dataset containing events that satisfy predicate.
§Errors
Returns RuntimeError when predicate compilation or evaluation
fails, or its expression is not real scalar-valued.
Sourcefn bin_by(
&self,
expr: &Expr,
bins: BinSpec,
execution: &Execution,
) -> RuntimeResult<Vec<DatasetBin>>
fn bin_by( &self, expr: &Expr, bins: BinSpec, execution: &Execution, ) -> RuntimeResult<Vec<DatasetBin>>
Partitions the dataset in one pass according to an expression and bin specification.
§Errors
Returns RuntimeError when expression compilation or evaluation
fails, or the expression is not real scalar-valued.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".