pub struct ExpressionEngine { /* private fields */ }Expand description
High-level expression engine
Implementations§
Source§impl ExpressionEngine
impl ExpressionEngine
pub fn new(context: ExpressionContext) -> Self
Sourcepub fn evaluate_compile_time(&self, expr: &str) -> Result<Value, EvalError>
pub fn evaluate_compile_time(&self, expr: &str) -> Result<Value, EvalError>
Evaluate a compile-time expression: ${{ expression }}
Sourcepub fn evaluate_runtime(&self, expr: &str) -> Result<Value, EvalError>
pub fn evaluate_runtime(&self, expr: &str) -> Result<Value, EvalError>
Evaluate a runtime expression: $[ expression ]
Sourcepub fn substitute_macros(&self, text: &str) -> Result<String, EvalError>
pub fn substitute_macros(&self, text: &str) -> Result<String, EvalError>
Substitute macro variables: $(variableName)
Sourcepub fn context_mut(&mut self) -> &mut ExpressionContext
pub fn context_mut(&mut self) -> &mut ExpressionContext
Get the context for modification
Sourcepub fn context(&self) -> &ExpressionContext
pub fn context(&self) -> &ExpressionContext
Get the context
Auto Trait Implementations§
impl Freeze for ExpressionEngine
impl RefUnwindSafe for ExpressionEngine
impl Send for ExpressionEngine
impl Sync for ExpressionEngine
impl Unpin for ExpressionEngine
impl UnsafeUnpin for ExpressionEngine
impl UnwindSafe for ExpressionEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more