1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::Expression;

/// An element with an optional expression.
pub trait WithOptionalExpression {
    /// Gets the optional expression.
    fn expression(&self) -> Option<&Box<dyn Expression>>;

    /// Sets the expression.
    fn with_expression<E>(self, expression: E) -> Self
    where
        E: 'static + Expression;

    /// Sets the expression.
    fn set_expression<E>(&mut self, expression: E)
    where
        E: 'static + Expression;
}