Struct som_interpreter_bc::class::Class
source · pub struct Class {
pub name: String,
pub class: MaybeWeak<Class>,
pub super_class: SOMWeakRef<Class>,
pub locals: IndexMap<Interned, Value>,
pub methods: IndexMap<Interned, Rc<Method>>,
pub is_static: bool,
}
Expand description
Represents a loaded class.
Fields§
§name: String
The class’ name.
class: MaybeWeak<Class>
The class of this class.
super_class: SOMWeakRef<Class>
The superclass of this class.
locals: IndexMap<Interned, Value>
The class’ locals.
methods: IndexMap<Interned, Rc<Method>>
The class’ methods/invokables.
is_static: bool
Is this class a static one ?
Implementations§
source§impl Class
impl Class
sourcepub fn set_class(&mut self, class: &SOMRef<Self>)
pub fn set_class(&mut self, class: &SOMRef<Self>)
Set the class of this class (as a weak reference).
sourcepub fn set_class_owned(&mut self, class: &SOMRef<Self>)
pub fn set_class_owned(&mut self, class: &SOMRef<Self>)
Set the class of this class (as a strong reference).
sourcepub fn super_class(&self) -> Option<SOMRef<Self>>
pub fn super_class(&self) -> Option<SOMRef<Self>>
Get the superclass of this class.
sourcepub fn set_super_class(&mut self, class: &SOMRef<Self>)
pub fn set_super_class(&mut self, class: &SOMRef<Self>)
Set the superclass of this class (as a weak reference).
sourcepub fn lookup_method(&self, signature: Interned) -> Option<Rc<Method>>
pub fn lookup_method(&self, signature: Interned) -> Option<Rc<Method>>
Search for a given method within this 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 Class
impl !RefUnwindSafe for Class
impl !Send for Class
impl !Sync for Class
impl Unpin for Class
impl !UnwindSafe for Class
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