Skip to main content

GcObject

Struct GcObject 

Source
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

Source

pub const unsafe fn from_raw(raw: NonNull<RawGcObject>) -> Self

Source

pub unsafe fn init_header(&self, thread: &Thread, type_tag: u8)

luaC_init

Source

pub unsafe fn to_string(&self) -> TString

gco2ts

Source

pub unsafe fn to_userdata(&self) -> Userdata

gco2u

Source

pub unsafe fn to_closure(&self) -> Closure

gco2cl

Source

pub unsafe fn to_table(&self) -> Table

gco2h

Source

pub unsafe fn to_proto(&self) -> Proto

gco2p

Source

pub unsafe fn to_upvalue(&self) -> UpVal

gco2uv

Source

pub unsafe fn to_state(&self) -> Thread

gco2th

Source

pub unsafe fn to_buffer(&self) -> Buffer

gco2buf

Source

pub unsafe fn to_class(&self) -> Class

gco2class

Source

pub unsafe fn to_object(&self) -> Object

gco2object

Source§

impl GcObject

Source

pub unsafe fn is_white(&self) -> bool

iswhite

Source

pub unsafe fn is_black(&self) -> bool

isblack

Source

pub unsafe fn is_gray(&self) -> bool

isgray

Source

pub unsafe fn change_white(&mut self)

changewhite

Source

pub unsafe fn gray_to_black(&mut self)

gray2black

Source

pub unsafe fn white_to_gray(&mut self)

white2gray

Source

pub unsafe fn black_to_gray(&mut self)

black2gray

Trait Implementations§

Source§

impl AsRef<GcObject> for GcObject

Source§

fn as_ref(&self) -> &GcObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for GcObject

Source§

fn clone(&self) -> GcObject

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for GcObject

Source§

impl Eq for GcObject

Source§

impl From<&Thread> for GcObject

Source§

fn from(value: &Thread) -> Self

Converts to this type from the input type.
Source§

impl From<Buffer> for GcObject

Source§

fn from(value: Buffer) -> Self

Converts to this type from the input type.
Source§

impl From<Class> for GcObject

Source§

fn from(value: Class) -> Self

Converts to this type from the input type.
Source§

impl From<Closure> for GcObject

Source§

fn from(value: Closure) -> Self

Converts to this type from the input type.
Source§

impl From<LuaNode> for GcObject

Source§

fn from(value: LuaNode) -> Self

Converts to this type from the input type.
Source§

impl From<Object> for GcObject

Source§

fn from(value: Object) -> Self

Converts to this type from the input type.
Source§

impl From<Proto> for GcObject

Source§

fn from(value: Proto) -> Self

Converts to this type from the input type.
Source§

impl From<TString> for GcObject

Source§

fn from(value: TString) -> Self

Converts to this type from the input type.
Source§

impl From<TValue> for GcObject

Source§

fn from(value: TValue) -> Self

Converts to this type from the input type.
Source§

impl From<Table> for GcObject

Source§

fn from(value: Table) -> Self

Converts to this type from the input type.
Source§

impl From<Thread> for GcObject

Source§

fn from(value: Thread) -> Self

Converts to this type from the input type.
Source§

impl From<UpVal> for GcObject

Source§

fn from(value: UpVal) -> Self

Converts to this type from the input type.
Source§

impl From<Userdata> for GcObject

Source§

fn from(value: Userdata) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for GcObject

Source§

fn eq(&self, other: &GcObject) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl RawHandle for GcObject

Source§

type Raw = RawGcObject

Raw VM record addressed by this handle.
Source§

fn as_ptr(&self) -> *mut Self::Raw

Returns the record address without dereferencing it.
Source§

impl StructuralPartialEq for GcObject

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.