API Reference

Functions

fn eprintln(args: Array<Any>)

Print the argument values as one line on standard error, descriptor 2.

eprintln!("warning");
Run in Playground
fn printErrorLine(text: String)

Print a String followed by a newline on standard error.

printErrorLine("bad input");
Run in Playground
fn printErrorText(text: String)

Print a String with no trailing newline on standard error.

printErrorText("bad input");
Run in Playground
fn printLine(text: String)

Print a String followed by a newline, without the argument array the call macros build.

printLine("plain line");
Run in Playground
fn printText(text: String)

Print a String with no trailing newline.

printText("no newline");
Run in Playground
fn println(args: Array<Any>)

Print the argument values as one line on standard output.

Arguments are joined with a single space and the line ends with \n. The bytes leave the module through fd_write on descriptor 1.

println!("hello wasi");
Run in Playground
fn wasi_println(args: Array<Any>)

The same macro under a name that cannot be confused with the host console macro.

wasi_println!("hello wasi");
Run in Playground