Function get_interface_handle

Source
pub unsafe fn get_interface_handle(
    file: &str,
) -> Result<CreateInterfaceFn, Error>
Expand description

Gets a handle to provided source interface You should really use the iface macro instead

§Arguments

  • file - Filename of the interface dll, linked to gmod. For example “engine.dll”

§Safety

This function internally gets the symbol to the CreateInterface function and casts it to the desired interface provided So make sure you pass the correct interface type and a valid dll.

§Examples

use rglua::interface::get_interface_handle;
unsafe {
    let vgui = get_interface_handle("vgui2.dll")
        .expect("Couldn't link to vgui2.dll");
};