pub struct CodeBlock<'a> { /* private fields */ }
Expand description

Code block consists of statements and acts as anonymous namespace scope for items and variable declarations.

Implementations

Declare variable name of a type.

Assignment statement. Assign a expression value to a variable.

Declare variable with initialization.

Call external function for side effect only.

Construct a if-then-else block with each part provided.

E.g. if n == 0 { r = 0 } else { r = 1} could be write as: x.if_block( |cond| cond.eq(cond.id(“n”)?, cond.lit_i(0)), |t| { t.assign(“r”, t.lit_i(0))?; Ok(()) }, |e| t.assign(“r”, t.lit_i(1))?; Ok(()) }, )?;

Construct a while block with each part provided.

E.g. while n != 0 { n = n - 1;} could be write as: x.while_block( |cond| cond.ne(cond.id(“n”)?, cond.lit_i(0)), |w| { w.assign(“n”, w.sub(w.id(“n”)?, w.lit_i(1))?)?; Ok(()) }, )?;

Create a literal val of ty type.

Shorthand to create i64 literal

Shorthand to create f32 literal

Shorthand to create f64 literal

Shorthand to create boolean literal

Create a reference to an already defined variable.

Binary comparison expression: lhs == rhs

Binary comparison expression: lhs != rhs

Binary comparison expression: lhs < rhs

Binary comparison expression: lhs <= rhs

Binary comparison expression: lhs > rhs

Binary comparison expression: lhs >= rhs

Binary arithmetic expression: lhs + rhs

Binary arithmetic expression: lhs - rhs

Binary arithmetic expression: lhs * rhs

Binary arithmetic expression: lhs / rhs

Call external function name with parameters

Return the value pointed to by the ptr stored in ptr

Store the value in value to the address in ptr

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.