pub struct GcObject { /* private fields */ }Expand description
Non-owning identity of a collectable VM record.
§Safety model for unsafe methods
The allocation must be live and correctly tagged for the requested conversion in its owning VM. The handle does not root the object, and any collection or destruction that frees it invalidates every copy.
Implementations§
Source§impl GcObject
impl GcObject
pub const unsafe fn from_raw(raw: NonNull<RawGcObject>) -> Self
Sourcepub unsafe fn init_header(&self, thread: &Thread, type_tag: u8)
pub unsafe fn init_header(&self, thread: &Thread, type_tag: u8)
luaC_init
Sourcepub unsafe fn to_userdata(&self) -> Userdata
pub unsafe fn to_userdata(&self) -> Userdata
gco2u
Sourcepub unsafe fn to_closure(&self) -> Closure
pub unsafe fn to_closure(&self) -> Closure
gco2cl
Sourcepub unsafe fn to_upvalue(&self) -> UpVal
pub unsafe fn to_upvalue(&self) -> UpVal
gco2uv
Source§impl GcObject
impl GcObject
Sourcepub unsafe fn change_white(&mut self)
pub unsafe fn change_white(&mut self)
changewhite
Sourcepub unsafe fn gray_to_black(&mut self)
pub unsafe fn gray_to_black(&mut self)
gray2black
Sourcepub unsafe fn white_to_gray(&mut self)
pub unsafe fn white_to_gray(&mut self)
white2gray
Sourcepub unsafe fn black_to_gray(&mut self)
pub unsafe fn black_to_gray(&mut self)
black2gray
Trait Implementations§
impl Copy for GcObject
impl Eq for GcObject
impl StructuralPartialEq for GcObject
Auto Trait Implementations§
impl !Send for GcObject
impl !Sync for GcObject
impl Freeze for GcObject
impl RefUnwindSafe for GcObject
impl Unpin for GcObject
impl UnsafeUnpin for GcObject
impl UnwindSafe for GcObject
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