Enum liquid_core::runtime::Expression
source · pub enum Expression {
Variable(Variable),
Literal(Value),
}Expand description
An un-evaluated Value.
Variants§
Implementations§
source§impl Expression
impl Expression
sourcepub fn with_literal<S: Into<Scalar>>(literal: S) -> Self
pub fn with_literal<S: Into<Scalar>>(literal: S) -> Self
Create an expression from a scalar literal.
sourcepub fn into_literal(self) -> Option<Value>
pub fn into_literal(self) -> Option<Value>
Convert into a literal if possible.
sourcepub fn into_variable(self) -> Option<Variable>
pub fn into_variable(self) -> Option<Variable>
Convert into a variable, if possible.
sourcepub fn try_evaluate<'c>(
&'c self,
runtime: &'c dyn Runtime,
) -> Option<ValueCow<'c>>
pub fn try_evaluate<'c>( &'c self, runtime: &'c dyn Runtime, ) -> Option<ValueCow<'c>>
Convert to a Value.
Trait Implementations§
source§impl Clone for Expression
impl Clone for Expression
source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for Expression
impl Debug for Expression
source§impl Display for Expression
impl Display for Expression
source§impl Extend<Expression> for Variable
impl Extend<Expression> for Variable
source§fn extend<T: IntoIterator<Item = Expression>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Expression>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl PartialEq for Expression
impl PartialEq for Expression
source§fn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
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