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>
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>)
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 !Freeze for PackageObj
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