gmod-rs fork
Go to file
William Venner 3ad2750c09 Add `pcall_ignore` 2021-11-02 15:13:08 +00:00
gmod Add `pcall_ignore` 2021-11-02 15:13:08 +00:00
gmod-macros Replace lazy_static Lua Shared struct with a much faster single-threaded abstraction 2021-10-21 15:16:40 +01:00
tests Add support for full userdata with proper dropping support 2021-10-23 20:05:52 +01:00
.editorconfig Initial commit 2021-09-09 21:50:58 +01:00
.gitignore Add support for full userdata with proper dropping support 2021-10-23 20:05:52 +01:00
Cargo.lock re-export gmserverplugin with new feature flag 2021-10-27 20:46:13 +01:00
Cargo.toml Initial commit 2021-09-09 21:50:58 +01:00
LICENSE Initial commit 2021-09-09 21:50:58 +01:00
README.md Add `c_unwind` feature to example 2021-10-21 19:08:09 +01:00
rust-toolchain.toml Initial commit 2021-09-09 21:50:58 +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

#![feature(c_unwind)]

#[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
}