Enum liquid_core::Expression
source · [−]Expand description
An un-evaluated Value
.
Variants
Variable(Variable)
Un-evaluated.
Literal(Value)
Evaluated.
Implementations
sourceimpl 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
sourceimpl Clone for Expression
impl Clone for Expression
sourcefn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Expression
impl Debug for Expression
sourceimpl Display for Expression
impl Display for Expression
sourceimpl Extend<Expression> for Variable
impl Extend<Expression> for Variable
sourcefn 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
sourcefn 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.
sourcefn 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
sourceimpl PartialEq<Expression> for Expression
impl PartialEq<Expression> for Expression
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &Expression) -> bool
fn ne(&self, other: &Expression) -> bool
This method tests for !=
.
impl StructuralPartialEq for Expression
Auto Trait Implementations
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more