pub enum Expression {
Show 18 variants
ArrayAccess(Box<ArrayAccess>),
AssociatedConstant(AssociatedConstantExpression),
AssociatedFunction(AssociatedFunctionExpression),
Array(ArrayExpression),
Binary(Box<BinaryExpression>),
Call(Box<CallExpression>),
Cast(Box<CastExpression>),
Err(ErrExpression),
Identifier(Identifier),
Literal(Literal),
Locator(LocatorExpression),
MemberAccess(Box<MemberAccess>),
Struct(StructExpression),
Ternary(Box<TernaryExpression>),
Tuple(TupleExpression),
TupleAccess(Box<TupleAccess>),
Unary(Box<UnaryExpression>),
Unit(UnitExpression),
}Expand description
Expression that evaluates to a value.
Variants§
ArrayAccess(Box<ArrayAccess>)
An array access, e.g. arr[i].
AssociatedConstant(AssociatedConstantExpression)
An associated constant; e.g., group::GEN.
AssociatedFunction(AssociatedFunctionExpression)
An associated function; e.g., BHP256::hash_to_field.
Array(ArrayExpression)
An array expression, e.g., [true, false, true, false].
Binary(Box<BinaryExpression>)
A binary expression, e.g., 42 + 24.
Call(Box<CallExpression>)
A call expression, e.g., my_fun(args).
Cast(Box<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.
MemberAccess(Box<MemberAccess>)
An access of a struct member, e.g. struc.member.
Struct(StructExpression)
An expression constructing a struct like Foo { bar: 42, baz }.
Ternary(Box<TernaryExpression>)
A ternary conditional expression cond ? if_expr : else_expr.
Tuple(TupleExpression)
A tuple expression e.g., (foo, 42, true).
TupleAccess(Box<TupleAccess>)
A tuple access expression e.g., foo.2.
Unary(Box<UnaryExpression>)
An unary expression.
Unit(UnitExpression)
A unit expression e.g. ()
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
Source§impl Display for Expression
impl Display for Expression
Source§impl From<ArrayAccess> for Expression
impl From<ArrayAccess> for Expression
Source§fn from(value: ArrayAccess) -> Self
fn from(value: ArrayAccess) -> Self
Source§impl From<ArrayExpression> for Expression
impl From<ArrayExpression> for Expression
Source§fn from(value: ArrayExpression) -> Self
fn from(value: ArrayExpression) -> Self
Source§impl From<AssociatedConstantExpression> for Expression
impl From<AssociatedConstantExpression> for Expression
Source§fn from(value: AssociatedConstantExpression) -> Self
fn from(value: AssociatedConstantExpression) -> Self
Source§impl From<AssociatedFunctionExpression> for Expression
impl From<AssociatedFunctionExpression> for Expression
Source§fn from(value: AssociatedFunctionExpression) -> Self
fn from(value: AssociatedFunctionExpression) -> Self
Source§impl From<BinaryExpression> for Expression
impl From<BinaryExpression> for Expression
Source§fn from(value: BinaryExpression) -> Self
fn from(value: BinaryExpression) -> Self
Source§impl From<CallExpression> for Expression
impl From<CallExpression> for Expression
Source§fn from(value: CallExpression) -> Self
fn from(value: CallExpression) -> Self
Source§impl From<CastExpression> for Expression
impl From<CastExpression> for Expression
Source§fn from(value: CastExpression) -> Self
fn from(value: CastExpression) -> Self
Source§impl From<ErrExpression> for Expression
impl From<ErrExpression> for Expression
Source§fn from(value: ErrExpression) -> Self
fn from(value: ErrExpression) -> Self
Source§impl From<Identifier> for Expression
impl From<Identifier> for Expression
Source§fn from(value: Identifier) -> Self
fn from(value: Identifier) -> Self
Source§impl From<Literal> for Expression
impl From<Literal> for Expression
Source§impl From<LocatorExpression> for Expression
impl From<LocatorExpression> for Expression
Source§fn from(value: LocatorExpression) -> Self
fn from(value: LocatorExpression) -> Self
Source§impl From<MemberAccess> for Expression
impl From<MemberAccess> for Expression
Source§fn from(value: MemberAccess) -> Self
fn from(value: MemberAccess) -> Self
Source§impl From<StructExpression> for Expression
impl From<StructExpression> for Expression
Source§fn from(value: StructExpression) -> Self
fn from(value: StructExpression) -> Self
Source§impl From<TernaryExpression> for Expression
impl From<TernaryExpression> for Expression
Source§fn from(value: TernaryExpression) -> Self
fn from(value: TernaryExpression) -> Self
Source§impl From<TupleAccess> for Expression
impl From<TupleAccess> for Expression
Source§fn from(value: TupleAccess) -> Self
fn from(value: TupleAccess) -> Self
Source§impl From<TupleExpression> for Expression
impl From<TupleExpression> for Expression
Source§fn from(value: TupleExpression) -> Self
fn from(value: TupleExpression) -> Self
Source§impl From<UnaryExpression> for Expression
impl From<UnaryExpression> for Expression
Source§fn from(value: UnaryExpression) -> Self
fn from(value: UnaryExpression) -> Self
Source§impl From<UnitExpression> for Expression
impl From<UnitExpression> for Expression
Source§fn from(value: UnitExpression) -> Self
fn from(value: UnitExpression) -> Self
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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