Skip to content
Konjure / spatial intelligence

Opt

← Builtin reference

An optional value that records presence explicitly.

Signature

enum Opt[T] { Some(T), None }

Match both Some and None before using an optional result.

Cases

Some(T)
Contains a present value of T.
None
Records that no value is present.

Examples

Match an optional value

Both cases make absence explicit.

Tick 0 · 0.00 s⌘ / Ctrl + EnterThis device
main.kj
Loading the language runtime…
Output 0
No output.
Expected output
4

Rust definition

Value::Enum with the concrete Opt[T] type and checked case payload.

See also