Struct som_interpreter_ast::class::Class
source · pub struct Class {
pub name: String,
pub class: MaybeWeak<Class>,
pub super_class: SOMWeakRef<Class>,
pub locals: IndexMap<String, Value>,
pub methods: IndexMap<String, 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<String, Value>
The class’ locals.
methods: IndexMap<String, Rc<Method>>
The class’ methods/invokables.
is_static: bool
Is this class a static one ?
Implementations§
source§impl Class
impl Class
sourcepub fn from_class_def(defn: ClassDef) -> Result<SOMRef<Class>, String>
pub fn from_class_def(defn: ClassDef) -> Result<SOMRef<Class>, String>
Load up a class from its class definition from the AST.
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).
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