Crate rglua

Source

Re-exports§

pub use lua::types;

Modules§

interface
lua
prelude
userdata
util

Macros§

cstr
Creates *const i8 from a &str This either takes a literal and appends a null char (\0) to it. or if it is an expression, tries to make a CString from it. Will panic if passed an expression that a CString could not be created from.
iface
Quickly retrieves access to a source engine interface for you. You can either use it through iface!(file, name, typename) or iface!(name).
printgm
Like println!, however it prints to the gmod server’s console. First arg is the lua state. Rest are varargs. Can be either a variable storing a str literal, or a referenced String / str variable
reg
Creates an array of LuaRegs for you to be used with luaL_register
rstr
Tries to convert a const char* to a &str Will panic if the const char* is not valid utf-8
try_cstr
Tries to create a *const i8 from a &str This either takes a literal and appends a null char (\0) to it. or if it is a value, makes a cstring and returns the pointer to it.
try_rstr
Tries to convert a const char* to an &str

Attribute Macros§

gmod_close
Creates the exitpoint to garrysmod. Compiles down to gmod13_close.
gmod_open
Creates the entrypoint to garrysmod. Compiles down to gmod13_open.
lua_function
Creates a valid function to be passed down to lua. Note this function will not be registered automatically for you, you must use luaL_register or functions like lua_pushcfunction. This may change in the future or allow for something like #[lua_function(name = “foo”, auto = true)]