gmod-rs/gmod
William Venner 76362dccc8 `#[inline]` -> `#[inline(always)]` 2021-10-21 15:16:44 +01:00
..
src `#[inline]` -> `#[inline(always)]` 2021-10-21 15:16:44 +01:00
Cargo.toml Replace lazy_static Lua Shared struct with a much faster single-threaded abstraction 2021-10-21 15:16:40 +01:00
README.md Publish 2021-09-17 18:08:22 +01:00

README.md

crates.io

docs.rs

⚙ gmod-rs

A swiss army knife for creating binary modules for Garry's Mod in Rust.

Example

rust-toolchain.toml

Because we're using the C-unwind ABI, this crate must be used on a Nightly Rust compiler.

[toolchain]
channel = "nightly"

Cargo.toml

[lib]
crate-type = ["cdylib"]

[dependencies]
gmod = "*"

lib.rs

#[macro_use]
extern crate gmod;

#[gmod13_open]
fn gmod13_open(lua: gmod::lua::State) -> i32 {
    println!("Hello from binary module!");
    0
}

#[gmod13_close]
fn gmod13_close(lua: gmod::lua::State) -> i32 {
    println!("Goodbye from binary module!");
    0
}