pub struct Table { /* private fields */ }Expand description
Non-owning identity of a VM table record.
§Safety model for unsafe methods
The table and referenced storage must remain live in its owning VM. Keys, values, nodes, and indices must match the current allocation; resize or free operations invalidate derived cursors and views. Mutation must preserve hashing, readonly, metatable-cache, and GC barrier invariants.
Implementations§
Source§impl Table
impl Table
pub const unsafe fn from_raw(raw: NonNull<RawLuaTable>) -> Self
pub unsafe fn node(&self, index: i32) -> LuaNode
pub unsafe fn node_mut(&mut self, index: i32) -> LuaNode
pub unsafe fn metatable(&self) -> Option<Table>
pub unsafe fn set_metatable(&self, metatable: Option<Table>)
pub unsafe fn gc_list(&self) -> Option<GcObject>
pub unsafe fn set_gc_list(&self, gc_list: Option<GcObject>)
pub unsafe fn invalidate_tm_cache(&self)
pub unsafe fn set_node(&self, node_cursor: LuaNodeCursor)
pub unsafe fn set_array(&self, array_cursor: TValueCursor)
pub unsafe fn has_dummy_node(&self) -> bool
pub unsafe fn node_index(&self, node_cursor: LuaNodeCursor) -> i32
Sourcepub unsafe fn value_slot_unchecked(&self, value: TValue) -> i32
pub unsafe fn value_slot_unchecked(&self, value: TValue) -> i32
gval2slot
§Safety
value must be a value pointer produced by luaH_get or luaH_setslot for this table.
pub unsafe fn node_cursor(&self) -> LuaNodeCursor
pub unsafe fn array_cursor(&self) -> TValueCursor
pub unsafe fn array_slot(&self, index: usize) -> TValue
pub unsafe fn array_slot_for_key(&self, key: i32) -> Option<TValue>
pub unsafe fn node_count(&self) -> usize
pub unsafe fn hash_mask(&self) -> usize
pub unsafe fn node_mask_8(&self) -> usize
pub unsafe fn array_storage_size(&self) -> usize
pub unsafe fn node_storage_size(&self) -> usize
pub unsafe fn allocation_size(&self) -> usize
pub unsafe fn gc_work_size(&self, count_dummy_node: bool) -> usize
pub unsafe fn init_empty_storage(&self)
pub unsafe fn free_storage(&self, thread: &Thread)
pub unsafe fn maybe_set_aboundary(&self, value: i32)
pub unsafe fn get_aboundary(&self) -> i32
Source§impl Table
impl Table
pub fn dummy_node_cursor() -> LuaNodeCursor
pub fn dummy_node() -> LuaNode
pub fn dummy_node_ptr() -> *mut RawLuaNode
Sourcepub fn array_index(key: f64) -> Option<i32>
pub fn array_index(key: f64) -> Option<i32>
arrayindex
Sourcepub unsafe fn main_position(&self, key: TValue) -> LuaNodeCursor
pub unsafe fn main_position(&self, key: TValue) -> LuaNodeCursor
mainposition
pub unsafe fn get_hash_node(&self, key: TValue) -> Option<LuaNodeCursor>
pub unsafe fn get_str_node(self, key: TString) -> Option<LuaNodeCursor>
Trait Implementations§
impl Copy for Table
impl Eq for Table
impl StructuralPartialEq for Table
Auto Trait Implementations§
impl !Send for Table
impl !Sync for Table
impl Freeze for Table
impl RefUnwindSafe for Table
impl Unpin for Table
impl UnsafeUnpin for Table
impl UnwindSafe for Table
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