Macro rsjs::js_int [] [src]

macro_rules! js_int {
    ($jscode:expr $(, $args:expr )*) => { ... };
}

Macro that evaluates a JavaScript code snippet which returns an integer.

Arguments

  • $jscode - A &'static str containing the JavaScript code that needs to be run.
  • $args, ... - Any number of arguments to be used by $jscode. All arguments must be of a type T where std::convert::From<T> for JSObject is implemented. They can be referenced in JavaScript snippet as $0, $1, ...

Note that the JavaScript snippet is responsible for unpacking the arguments itself using RSJS.loadObject(...) if the argument is not a simple number of boolean. See the documentation for JSObject for more information.

Return value

The return value of $jscode as an i32.

See also

For similar macros with different return types, see js!, js_double!, js_string! or js_obj!.