Struct go_vm::types::PackageObj
source · pub struct PackageObj { /* private fields */ }
Expand description
PackageObj is part of the generated Bytecode, it stores imports, consts, vars, funcs declared in a package
Implementations§
source§impl PackageObj
impl PackageObj
pub fn new(name: String) -> PackageObj
pub fn name(&self) -> &str
pub fn add_member(&mut self, name: String, val: GosValue) -> OpIndex
pub fn add_var_mapping(&mut self, name: String, fn_index: OpIndex) -> OpIndex
pub fn add_init_func(&mut self, func: GosValue)
pub fn member_indices(&self) -> &Map<String, OpIndex>
pub fn member_index(&self, name: &str) -> Option<&OpIndex>
pub fn inited(&self) -> bool
pub fn member(&self, i: OpIndex) -> Ref<'_, GosValue>
pub fn member_mut(&self, i: OpIndex) -> RefMut<'_, GosValue>
pub fn init_func(&self, i: OpIndex) -> Option<&GosValue>
pub fn init_vars(&self, vals: Vec<GosValue>)
Trait Implementations§
source§impl Clone for PackageObj
impl Clone for PackageObj
source§fn clone(&self) -> PackageObj
fn clone(&self) -> PackageObj
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more