| Macros |
Return type |
Description |
@print(fmt, ...) |
void |
write format to stdout |
@println(fmt, ...) |
void |
write format to stdout with newline |
@format(fmt, ...) |
String |
format values into heap String |
@dbg(expr) |
expr |
debug provided expression (Debug mode only) |
| Slot |
Meaning |
{} |
value (Display) |
{:?} |
debug (Debug) |
{hex} |
hexadecimal |
{oct} |
octal |
{bin} |
binary |
{:.N} |
float with N decimals |
Structs opt in through core.io interfaces. The sink is any StrWriter, so the same code feeds stdout and String:
implement Display : Point {
fn display[W: StrWriter](*const self, out: *W) void {