Macro rsjs::js_string [] [src]

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

Macro that evaluates a JavaScript code snippet which returns a string.

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

An instance of a std::string::String converted from the JavaScript string returned by $jscode.

See also

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