Skip to main content

Module result

Module result 

Source
Expand description

Result Type FFI Functions for JIT

Functions for creating and manipulating Result types (Ok/Err) in JIT-compiled code.

Functionsยง

jit_is_err
Check if a value is Err (returns TAG_BOOL_TRUE or TAG_BOOL_FALSE)
jit_is_none
Check if a value is None (returns TAG_BOOL_TRUE or TAG_BOOL_FALSE)
jit_is_ok
Check if a value is Ok (returns TAG_BOOL_TRUE or TAG_BOOL_FALSE)
jit_is_result
Check if a value is any Result type (Ok or Err)
jit_is_some
Check if a value is Some (returns TAG_BOOL_TRUE or TAG_BOOL_FALSE)
jit_make_err
Create an Err result wrapping the inner value
jit_make_ok
Create an Ok result wrapping the inner value
jit_make_some
Create a Some value wrapping the inner value
jit_result_inner
Map over Ok value - if Ok, applies function and returns new Ok This is a simplified version that just returns the inner value for now (full map support would require function call machinery)
jit_unwrap_err
Unwrap an Err value, returning the inner value If not Err, returns TAG_NULL
jit_unwrap_ok
Unwrap an Ok value, returning the inner value If not Ok, returns TAG_NULL
jit_unwrap_or
Unwrap Ok or return default value If Ok, returns the inner value; otherwise returns the default
jit_unwrap_some
Unwrap a Some value, returning the inner value If not Some, returns TAG_NULL