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
impl GlobalState
pub fn protected_error(&self) -> *mut LuaProtectedErrorFrame
pub fn set_protected_error(&self, protected_error: *mut LuaProtectedErrorFrame)
Source§impl GlobalState
impl GlobalState
pub fn gc_state(&self) -> u8
pub fn set_gc_state(&self, gc_state: u8)
pub fn gray(&self) -> Option<GcObject>
pub fn set_gray(&self, gray: Option<GcObject>)
pub fn gray_again(&self) -> Option<GcObject>
pub fn set_gray_again(&self, gray_again: Option<GcObject>)
pub fn weak(&self) -> Option<GcObject>
pub fn set_weak(&self, weak: Option<GcObject>)
Source§impl GlobalState
impl GlobalState
Source§impl GlobalState
impl GlobalState
pub fn all_gco_pages(&self) -> Option<LuaPage>
pub fn sweep_gco_page(&self) -> Option<LuaPage>
pub fn set_sweep_gco_page(&self, page: Option<LuaPage>)
Source§impl GlobalState
impl GlobalState
Source§impl GlobalState
impl GlobalState
Sourcepub fn callbacks(&self) -> *mut LuaCallbacks
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.
Sourcepub fn execution_callbacks(&self) -> *mut LuaExecutionCallbacks
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
impl GlobalState
pub const unsafe fn from_raw(raw: NonNull<RawGlobalState>) -> Self
pub unsafe fn main_thread(&self) -> Thread
pub fn encode_pointer(&self, pointer: usize) -> usize
pub fn registry(&self) -> TValue
pub fn pseudo_temp(&self) -> TValue
pub fn registry_free(&self) -> i32
pub fn set_registry_free(&self, registry_free: i32)
Source§impl GlobalState
impl GlobalState
pub fn userdata_direct_field(&self, tag: usize) -> Option<Table>
pub fn set_userdata_direct_field(&self, tag: usize, table: Option<Table>)
Source§impl GlobalState
impl GlobalState
pub fn userdata_metatable(&self, tag: usize) -> Option<Table>
pub fn set_userdata_metatable(&self, tag: usize, table: Option<Table>)
pub fn userdata_dtor(&self, tag: usize) -> Option<LuaDestructor>
pub fn set_userdata_dtor(&self, tag: usize, destructor: Option<LuaDestructor>)
pub fn userdata_mark(&self, tag: usize) -> Option<LuaUserdataMark>
pub fn set_userdata_mark(&self, tag: usize, mark: Option<LuaUserdataMark>)
pub fn light_userdata_name(&self, tag: usize) -> Option<TString>
pub fn set_light_userdata_name(&self, tag: usize, name: Option<TString>)
Trait Implementations§
Source§impl AsRef<GlobalState> for GlobalState
impl AsRef<GlobalState> for GlobalState
Source§fn as_ref(&self) -> &GlobalState
fn as_ref(&self) -> &GlobalState
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for GlobalState
impl Clone for GlobalState
Source§fn clone(&self) -> GlobalState
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GlobalState
impl Eq for GlobalState
Source§impl PartialEq for GlobalState
impl PartialEq for GlobalState
Source§impl RawHandle for GlobalState
impl RawHandle for GlobalState
impl StructuralPartialEq for GlobalState
Auto Trait Implementations§
impl !RefUnwindSafe for GlobalState
impl !Send for GlobalState
impl !Sync for GlobalState
impl !UnwindSafe for GlobalState
impl Freeze for GlobalState
impl Unpin for GlobalState
impl UnsafeUnpin for GlobalState
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