Skip to main content

if_installed

Macro if_installed 

if_installed!() { /* proc-macro */ }
Expand description

if_installed!(host, other_mod, { other_mod::call(); }): runs the block only where the optional dependency other_mod is installed. A native mod is built with the Cargo feature other_mod only when it is; a wasm mod is built with it and asks the game at the call, since an absent library’s functions trap. One guard for both builds.