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, context: &'c Context<'_>) -> Option<&'c Value>
pub fn try_evaluate<'c>(&'c self, context: &'c Context<'_>) -> Option<&'c Value>
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
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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