Skip to main content

Expression

Trait Expression 

Source
pub trait Expression:
    AsAny
    + Send
    + Sync {
    // Required methods
    fn base(&self) -> &ExpressionBase;
    fn evaluate(&self, params: &EvaluationContext<'_>) -> EvaluationResult;
    fn each_child<'a>(&'a self, visit: &mut dyn FnMut(&'a dyn Expression));
    fn equals(&self, other: &dyn Expression) -> bool;
    fn possible_outputs(&self) -> Vec<Option<Value>>;
    fn get_operator(&self) -> String;

    // Provided methods
    fn serialize(&self) -> MbglValue { ... }
    fn get_kind(&self) -> Kind { ... }
    fn get_type(&self) -> &Type { ... }
    fn dependencies(&self) -> Dependency { ... }
    fn has(&self, dep: Dependency) -> bool { ... }
}
Expand description

expression::Expression.

Required Methods§

Source

fn base(&self) -> &ExpressionBase

Source

fn evaluate(&self, params: &EvaluationContext<'_>) -> EvaluationResult

Source

fn each_child<'a>(&'a self, visit: &mut dyn FnMut(&'a dyn Expression))

Source

fn equals(&self, other: &dyn Expression) -> bool

operator==.

Source

fn possible_outputs(&self) -> Vec<Option<Value>>

Statically analyze the expression, attempting to enumerate possible outputs. Returns an array of values plus the sentinel null optional value, used to indicate that the complete set of outputs is statically undecidable.

Source

fn get_operator(&self) -> String

Provided Methods§

Source

fn serialize(&self) -> MbglValue

Source

fn get_kind(&self) -> Kind

Source

fn get_type(&self) -> &Type

Source

fn dependencies(&self) -> Dependency

Source

fn has(&self, dep: Dependency) -> bool

Test the expression’s dependencies for any of one or more values.

Trait Implementations§

Source§

impl Debug for dyn Expression

Source§

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

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

impl PartialEq for dyn Expression

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§