Skip to main content

Module typed_result

Module typed_result 

Source
Expand description

Typed Result representations for v2 runtime.

Result<T, E> is a tagged union: tag (0=Ok, 1=Err) + payload. Size = 8 + max(sizeof(T), sizeof(E)). Monomorphized per instantiation.

Since Rust #[repr(C)] unions with generics are awkward, we provide concrete instantiations for common Shape result types.

Structs§

ResultF64Str
Result<f64, *const StringObj> — Ok is f64, Err is string pointer.
ResultI64Str
Result<i64, *const StringObj> — Ok is i64, Err is string pointer.
ResultPtrStr
Result<*const T, *const StringObj> — Ok is a heap pointer, Err is string pointer.

Constants§

RESULT_OFFSET_PAYLOAD
RESULT_OFFSET_TAG
Byte offset constants for JIT codegen.
RESULT_TAG_ERR
Tag value for Err variant.
RESULT_TAG_OK
Tag value for Ok variant.