Type Alias StaticLua

Source
pub type StaticLua = Lua<Ignore>;
Expand description

A static lua context that must be created from an existing lua state pointer and that will not be closed when dropped.

Aliased Type§

pub struct StaticLua { /* private fields */ }

Implementations§

Source§

impl StaticLua

Source

pub unsafe fn from_static<T>(lua: *mut T) -> Self

Takes an existing lua_State and build a StaticLua object from it.

lua_close is NOT called in drop.

§Safety

A pointer to a valid lua context must be provided.

Source

pub fn new_thread(&self) -> LuaThread

Creates a new Lua thread with an independent stack and runs the provided function within it. The new state has access to all the global objects available to self.

Trait Implementations§

Source§

impl<L: AsLua> LuaRead<L> for StaticLua

Source§

fn lua_read_at_maybe_zero_position(lua: L, _: i32) -> ReadResult<Self, L>

Source§

fn lua_read_at_position(lua: L, _: NonZeroI32) -> ReadResult<Self, L>

Reads the data from Lua at a given position.
Source§

fn n_values_expected() -> i32

Source§

fn lua_read(lua: L) -> ReadResult<Self, L>

Reads the data from Lua.