Skip to main content

GlobalState

Struct GlobalState 

Source
pub struct GlobalState { /* private fields */ }
Expand description

Non-owning identity of a VM’s global state record.

§Safety model for unsafe methods

The owning VM must remain live. Returned threads, objects, pointers, and record views are non-owning and must not outlive their storage. Mutation must be serialized with VM execution and preserve the owning subsystem’s invariants.

Implementations§

Source§

impl GlobalState

Source§

impl GlobalState

Source

pub unsafe fn uv_head(&self) -> UpVal

Source§

impl GlobalState

Source

pub fn gc_state(&self) -> u8

Source

pub fn set_gc_state(&self, gc_state: u8)

Source

pub fn gray(&self) -> Option<GcObject>

Source

pub fn set_gray(&self, gray: Option<GcObject>)

Source

pub fn gray_again(&self) -> Option<GcObject>

Source

pub fn set_gray_again(&self, gray_again: Option<GcObject>)

Source

pub fn weak(&self) -> Option<GcObject>

Source

pub fn set_weak(&self, weak: Option<GcObject>)

Source§

impl GlobalState

Source

pub fn white(&self) -> u8

luaC_white

Source

pub unsafe fn keep_invariant(&self) -> bool

keepinvariant

Source

pub unsafe fn is_dead(&self, object: GcObject) -> bool

isdead

Source

pub unsafe fn make_white(&self, object: GcObject)

makewhite

Source§

impl GlobalState

Source§

impl GlobalState

Source

pub unsafe fn type_name(&self, tag: usize) -> TString

Source

pub unsafe fn tm_name(&self, event: usize) -> TString

Source

pub fn metatable(&self, tag: usize) -> Option<Table>

Source§

impl GlobalState

Source

pub fn callbacks(&self) -> *mut LuaCallbacks

Returns the VM-owned public callback record address.

The pointer is for quiescent installation and focused VM reads. It does not establish a Rust borrow and must not be used to mutate the record while the VM is executing.

Source

pub fn execution_callbacks(&self) -> *mut LuaExecutionCallbacks

Returns the VM-owned execution callback record address.

The pointer is for quiescent installation and focused VM reads. It does not establish a Rust borrow and must not be used to mutate the record while the VM is executing.

Source§

impl GlobalState

Source

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

Source

pub unsafe fn main_thread(&self) -> Thread

Source

pub fn encode_pointer(&self, pointer: usize) -> usize

Source

pub fn registry(&self) -> TValue

Source

pub fn pseudo_temp(&self) -> TValue

Source

pub fn registry_free(&self) -> i32

Source

pub fn set_registry_free(&self, registry_free: i32)

Source§

impl GlobalState

Source§

impl GlobalState

Source

pub fn userdata_metatable(&self, tag: usize) -> Option<Table>

Source

pub fn set_userdata_metatable(&self, tag: usize, table: Option<Table>)

Source

pub fn userdata_dtor(&self, tag: usize) -> Option<LuaDestructor>

Source

pub fn set_userdata_dtor(&self, tag: usize, destructor: Option<LuaDestructor>)

Source

pub fn userdata_mark(&self, tag: usize) -> Option<LuaUserdataMark>

Source

pub fn set_userdata_mark(&self, tag: usize, mark: Option<LuaUserdataMark>)

Source

pub fn light_userdata_name(&self, tag: usize) -> Option<TString>

Source

pub fn set_light_userdata_name(&self, tag: usize, name: Option<TString>)

Trait Implementations§

Source§

impl AsRef<GlobalState> for GlobalState

Source§

fn as_ref(&self) -> &GlobalState

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

impl Clone for GlobalState

Source§

fn clone(&self) -> GlobalState

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 GlobalState

Source§

impl Eq for GlobalState

Source§

impl PartialEq for GlobalState

Source§

fn eq(&self, other: &GlobalState) -> 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 GlobalState

Source§

type Raw = RawGlobalState

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 GlobalState

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.