Skip to main content

buf_init

Function buf_init 

Source
pub fn buf_init(state: &mut LuaState, buf: &mut LuaBuffer)
Expand description

Initialize buf and associate it with state. Pushes a placeholder light-userdata onto state to anchor the buffer in C. In Rust the Vec is self-contained; we still push a placeholder for stack-slot compatibility with code that later calls add_value / push_result.

C: LUALIB_API void luaL_buffinit(lua_State *L, luaL_Buffer *B)