pub struct Code {
pub params: Vec<String>,
pub variadic: Option<String>,
pub kind: FunctionKind,
pub code: Vec<OpCode>,
pub consts: Vec<ConstValue>,
pub local_names: Vec<String>,
pub global_names: Vec<String>,
pub upvalue_names: Vec<(String, usize, usize)>,
pub def_upvalue_count: usize,
pub stack_size: usize,
}Expand description
A Code, generated by codegen and executed in LVM.
Fields§
§params: Vec<String>Name of parameters.
variadic: Option<String>Name of variadic parameter.
kind: FunctionKindFunction kind.
code: Vec<OpCode>Bytecode, a list of OpCodes.
consts: Vec<ConstValue>List of constants used in the bytecode.
local_names: Vec<String>List of local names.
global_names: Vec<String>List of global names.
upvalue_names: Vec<(String, usize, usize)>List of Upvalue information.
def_upvalue_count: usizeThe count of upvalues defined in the function.
stack_size: usizeThe required virtual machine stack space.
Trait Implementations§
Source§impl Collect for Codewhere
Self: 'static,
impl Collect for Codewhere
Self: 'static,
Source§fn needs_trace() -> bool
fn needs_trace() -> bool
As an optimization, if this type can never hold a
Gc pointer and trace is unnecessary
to call, you may implement this method and return false. The default implementation returns
true, signaling that Collect::trace must be called.Source§fn trace(&self, _cc: &Collection)
fn trace(&self, _cc: &Collection)
Must call
Collect::trace on all held Gc pointers. If this type holds inner types that
implement Collect, a valid implementation would simply call Collect::trace on all the
held values to ensure this.Auto Trait Implementations§
impl Freeze for Code
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnwindSafe for Code
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