pub enum Expression {
Show 14 variants
Access(AccessExpression),
Array(ArrayExpression),
Binary(BinaryExpression),
Call(CallExpression),
Cast(CastExpression),
Err(ErrExpression),
Identifier(Identifier),
Literal(Literal),
Locator(LocatorExpression),
Struct(StructExpression),
Ternary(TernaryExpression),
Tuple(TupleExpression),
Unary(UnaryExpression),
Unit(UnitExpression),
}
Expand description
Expression that evaluates to a value.
Variants§
Access(AccessExpression)
A struct access expression, e.g. Foo.bar
.
Array(ArrayExpression)
An array expression, e.g., [true, false, true, false]
.
Binary(BinaryExpression)
A binary expression, e.g., 42 + 24
.
Call(CallExpression)
A call expression, e.g., my_fun(args)
.
Cast(CastExpression)
A cast expression, e.g., 42u32 as u8
.
Err(ErrExpression)
An expression of type “error”. Will result in a compile error eventually.
Identifier(Identifier)
An identifier.
Literal(Literal)
A literal expression.
Locator(LocatorExpression)
A locator expression, e.g., hello.aleo/foo
.
Struct(StructExpression)
An expression constructing a struct like Foo { bar: 42, baz }
.
Ternary(TernaryExpression)
A ternary conditional expression cond ? if_expr : else_expr
.
Tuple(TupleExpression)
A tuple expression e.g., (foo, 42, true)
.
Unary(UnaryExpression)
An unary expression.
Unit(UnitExpression)
A unit expression e.g. ()
Implementations§
Source§impl Expression
impl Expression
pub(crate) fn precedence(&self) -> u32
pub(crate) fn associativity(&self) -> Associativity
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 Default for Expression
impl Default for Expression
Source§impl<'de> Deserialize<'de> for Expression
impl<'de> Deserialize<'de> for Expression
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Expression
impl Display for Expression
Source§impl Node for Expression
impl Node for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
Source§impl Serialize for Expression
impl Serialize for Expression
impl Eq 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,
§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
fn take_from_value<D>(
value: &mut Value,
field: &str,
) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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