The single empty value returned by procedures.
Signature
Unit is represented by the payload-free Rust Value::Unit variant and spelled () in the language. A function returning Unit may end without a value or use ret;. Unit is not null, an absent field, or an optional value.
Examples
Return from a procedure
The procedure logs its work; its result is the empty value ().
main.kj
Loading…Drag to orbit · select to inspect
0 entities
Scene controls
Results
Loading the language runtime…
Output 0
No output.
State
Compile source to inspect its values.
TraceNo execution yet
- Executed source spans appear here.
Expected output
ready ()
Rust definition
Value::Unit; a Rust enum variant with no payload.
View Rust documentation →Support: runtime