Struct som_interpreter_bc::instance::Instance
source · pub struct Instance {
pub class: SOMRef<Class>,
pub locals: Vec<Value>,
}
Expand description
Represents a generic (non-primitive) class instance.
Fields§
§class: SOMRef<Class>
The class of which this is an instance from.
locals: Vec<Value>
This instance’s locals.
Implementations§
source§impl Instance
impl Instance
sourcepub fn from_class(class: SOMRef<Class>) -> Self
pub fn from_class(class: SOMRef<Class>) -> Self
Construct an instance for a given class.
sourcepub fn super_class(&self) -> Option<SOMRef<Class>>
pub fn super_class(&self) -> Option<SOMRef<Class>>
Get the superclass of this instance’s class.
sourcepub fn lookup_local(&self, idx: usize) -> Option<Value>
pub fn lookup_local(&self, idx: usize) -> Option<Value>
Search for a local binding.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Instance
impl !RefUnwindSafe for Instance
impl !Send for Instance
impl !Sync for Instance
impl Unpin for Instance
impl !UnwindSafe for Instance
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