pub struct Object { /* private fields */ }Expand description
Non-owning identity of a VM object-instance record.
§Safety model for unsafe methods
The object and its class must be live records in the same VM. Member indices and cached offsets must be valid for that class, and writes must preserve the collector’s barrier and list invariants.
Implementations§
Source§impl Object
impl Object
pub const unsafe fn from_raw(raw: NonNull<RawLuauObject>) -> Self
pub unsafe fn class(&self) -> Class
pub unsafe fn member(&self, index: usize) -> TValue
pub unsafe fn gc_list(&self) -> Option<GcObject>
pub unsafe fn set_gc_list(&self, gc_list: Option<GcObject>)
pub unsafe fn gc_list_slot(&self) -> *mut *mut RawGcObject
pub unsafe fn allocation_size(&self) -> usize
Sourcepub fn offset_in_bounds(&self, offset: u32) -> bool
pub fn offset_in_bounds(&self, offset: u32) -> bool
luaR_checkoffsetinbounds
Sourcepub unsafe fn lookup_member_at_offset(&self, offset: u32) -> TValue
pub unsafe fn lookup_member_at_offset(&self, offset: u32) -> TValue
luaR_lookupmemberatoffset
pub unsafe fn lookup_member(&self, key: TValue) -> Option<TValue>
pub unsafe fn lookup_member_cached( &self, key: TString, slot: u8, ) -> ObjectMemberLookup
Trait Implementations§
impl Copy for Object
impl Eq for Object
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl !Send for Object
impl !Sync for Object
impl Freeze for Object
impl RefUnwindSafe for Object
impl Unpin for Object
impl UnsafeUnpin for Object
impl UnwindSafe for Object
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