Struct go_engine::ffi::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) -> i32
pub fn add_var_mapping(&mut self, name: String, fn_index: i32) -> i32
pub fn add_init_func(&mut self, func: GosValue)
pub fn member_indices(&self) -> &HashMap<String, i32, RandomState>
pub fn member_index(&self, name: &str) -> Option<&i32>
pub fn inited(&self) -> bool
pub fn member(&self, i: i32) -> Ref<'_, GosValue>
pub fn member_mut(&self, i: i32) -> RefMut<'_, GosValue>
pub fn init_func(&self, i: i32) -> Option<&GosValue>
pub fn init_vars(&self, vals: Vec<GosValue, Global>)
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for PackageObj
impl !Send for PackageObj
impl !Sync for PackageObj
impl Unpin for PackageObj
impl !UnwindSafe for PackageObj
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