pub trait LuaTableRefExt {
// Required methods
fn metatable(&self) -> Option<GcRef<LuaTable>>;
fn as_ptr(&self) -> *const ();
fn get(&self, _k: &LuaValue) -> LuaValue;
fn get_int(&self, _k: i64) -> LuaValue;
fn get_short_str(&self, _k: &GcRef<LuaString>) -> LuaValue;
fn raw_set(
&self,
_state: &mut LuaState,
_k: LuaValue,
_v: LuaValue,
) -> Result<(), LuaError>;
fn raw_set_int(
&self,
_state: &mut LuaState,
_k: i64,
_v: LuaValue,
) -> Result<(), LuaError>;
fn invalidate_tm_cache(&self);
fn resize(
&self,
_state: &mut LuaState,
_na: usize,
_nh: usize,
) -> Result<(), LuaError>;
fn next(
&self,
_k: LuaValue,
) -> Result<Option<(LuaValue, LuaValue)>, LuaError>;
}Expand description
GcRef<LuaTable> / GcRef<LuaUserData> field-access helpers. These
methods are needed by api.rs and tagmethods.rs but the lua-types
placeholders don’t yet expose them. TODO(phase-b): replace with real
accessor methods on the canonical types in lua-types.
PORT NOTE: the historical reject_invalid_table_key precheck used to
guard nil/NaN keys at this layer; it has moved inside
LuaTable::try_raw_set (alongside the integer-fast-path match) so
the lua-vm wrapper does not double-check.
Required Methods§
fn metatable(&self) -> Option<GcRef<LuaTable>>
fn as_ptr(&self) -> *const ()
fn get(&self, _k: &LuaValue) -> LuaValue
fn get_int(&self, _k: i64) -> LuaValue
fn get_short_str(&self, _k: &GcRef<LuaString>) -> LuaValue
fn raw_set( &self, _state: &mut LuaState, _k: LuaValue, _v: LuaValue, ) -> Result<(), LuaError>
fn raw_set_int( &self, _state: &mut LuaState, _k: i64, _v: LuaValue, ) -> Result<(), LuaError>
fn invalidate_tm_cache(&self)
fn resize( &self, _state: &mut LuaState, _na: usize, _nh: usize, ) -> Result<(), LuaError>
fn next(&self, _k: LuaValue) -> Result<Option<(LuaValue, LuaValue)>, LuaError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".