Attribute Macro gmod_close

Source
#[gmod_close]
Expand description

Creates the exitpoint to garrysmod. Compiles down to gmod13_close.

Normally you would not be able to return types other than i32 through to gmod13_open, this is still true, but this proc-macro allows it through unwrapping the result and containing attributes on a hidden generated function.

ยงExamples

use rglua::prelude::*;
#[gmod_close]
fn exit(state: LuaState) -> Result<i32, std::io::Error> {
    printgm!(state, "Goodbye, gmod!");
    // Do your cleanup stuff here.
    // We don't push objects to lua, so return 0 (# of returns)
    Ok(0)
}