pub struct Function {
pub args: AstIndex,
pub local_count: usize,
pub accessed_non_locals: AstVec<ConstantIndex>,
pub body: AstIndex,
pub is_generator: bool,
}Expand description
A function definition
Fields§
§args: AstIndexThe function’s arguments
See Node::FunctionArgs.
local_count: usizeThe number of locally assigned values
Used by the compiler when reserving registers for local values at the start of the frame.
accessed_non_locals: AstVec<ConstantIndex>Any non-local values that are accessed in the function
Any ID (or chain root) that’s accessed in a function and which wasn’t previously assigned locally, is either an export or the value needs to be captured. The compiler takes care of determining if an access is a capture or not at the moment the function is created.
body: AstIndexThe function’s body
is_generator: boolA flag that indicates if the function is a generator or not
The presence of a yield expression in the function body will set this to true.
Trait Implementations§
impl Eq for Function
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
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