Struct debris_llir::class::Class
source · pub struct Class {
pub kind: ClassKind,
pub properties: OnceCell<ObjectProperties>,
}
Expand description
A class combines ClassKind
and corresponding properties (Mostly associated methods).
Fields§
§kind: ClassKind
§properties: OnceCell<ObjectProperties>
Implementations§
source§impl Class
impl Class
sourcepub fn matches(&self, other: &Class) -> bool
pub fn matches(&self, other: &Class) -> bool
Returns if the value class other
matches this pattern
sourcepub fn matches_type(&self, other: &Class) -> bool
pub fn matches_type(&self, other: &Class) -> bool
Returns whether the other class has the same type as this class or diverges.
sourcepub fn get_property(&self, ident: &Ident) -> Option<ObjectRef>
pub fn get_property(&self, ident: &Ident) -> Option<ObjectRef>
sourcepub fn new_obj_from_allocator(
&self,
ctx: &TypeContext,
allocator: &ItemIdAllocator
) -> Option<ObjectRef>
pub fn new_obj_from_allocator( &self, ctx: &TypeContext, allocator: &ItemIdAllocator ) -> Option<ObjectRef>
Constructs a new runtime object that corresponds to this class, if possible
Trait Implementations§
source§impl PartialEq for Class
impl PartialEq for Class
impl Eq for Class
impl StructuralEq for Class
impl StructuralPartialEq for Class
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.