pub enum Element {
Statement(Statement),
Expression(Expression, Option<Type>),
Block {
block: Block,
function_body: bool,
},
AleoExecution {
context: Box<AleoContext>,
registers: IndexMap<u64, Value>,
instruction_index: usize,
},
DelayedCall(Location),
DelayedAsyncBlock {
program: Symbol,
block: NodeID,
names: HashMap<Vec<Symbol>, Value>,
},
}Expand description
A Leo construct to be evauated.
Variants§
Statement(Statement)
A Leo statement.
Expression(Expression, Option<Type>)
A Leo expression. The optional type is an optional “expected type” for the expression. It helps when trying to resolve an unsuffixed literal.
Block
A Leo block.
We have a separate variant for Leo blocks for two reasons:
- In a ConditionalExpression, the
thenblock is stored as just a Block with no statement, and - We need to remember if a Block came from a function body,
so that if such a block ends, we know to push a
Unitto the values stack.
AleoExecution
DelayedCall(Location)
DelayedAsyncBlock
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Element
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
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<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