A recoverable success or error result.
Signature
enum Res[T, E] { Ok(T), Err(E) }Use ? to propagate Err to a compatible Res-returning boundary, or match both cases locally.
Cases
Ok(T)- Contains a successful value of T.
Err(E)- Contains a recoverable error of E.
Examples
Match a result
A result carries either its value or its error payload.
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
4
Rust definition
Value::Enum with the concrete Res[T, E] type and checked case payload.
View Rust documentation →Support: runtime