xur_

> module

std::xur

how the program was started

use std::xur; in the browser

std::xur tells a script which host is running it, so one script can behave differently on the command line and inside a stub.

> functions

# invoked_by() -> str

Returns the name the host set at startup: "cli" for the xur command, "stub" inside xur-stub, and "web" in the browser build. Returns "unknown" when the host set none, for example when xur is embedded as a library.

> examples

use std::io;
use std::xur;

fn main() {
    if xur::invoked_by() == "stub" {
        io::println("running inside a game");
    } else {
        io::println("running from {}", xur::invoked_by());
    }
}