macro_rules! iface {
    ( LuaShared ) => { ... };
    ( EngineClient ) => { ... };
    ( EngineServer ) => { ... };
    ( MdlCache ) => { ... };
    ( MaterialSystem ) => { ... };
    ( Panel ) => { ... };
    ( ConVar ) => { ... };
    ( $name:literal, $iface:literal, $ty:ty ) => { ... };
}
Expand description

Quickly retrieves access to a source engine interface for you. You can either use it through iface!(file, name, typename) or iface!(name).

Examples

use rglua::prelude::*;
use rglua::interface::{EngineClient, self};
#[gmod_open]
fn entry(l: LuaState) -> Result<i32, interface::Error>  {
    let engine: &mut EngineClient = iface!("engine", "VEngineClient015", EngineClient)?;
    println!("Am I in game? {}", engine.IsInGame());
    Ok(0)
}
use rglua::prelude::*;
use rglua::interface;
#[gmod_open]
fn entry(l: LuaState) -> Result<i32, interface::Error>  {
   let engine: &mut interface::EngineClient = iface!(EngineClient)?;
   println!("Am I in game? {}", engine.IsInGame());
   Ok(0)
}