Normalized outcome helpers for engine return values.
The engine returns one of three tuple shapes:
{:ok, runtime}{:wait, runtime, wait_cfg}{:error, reason, runtime}
These helpers destructure any of those shapes uniformly, so orchestration code never hand-parses tuples.
Summary
Functions
Returns true if the result is an error.
Returns the error reason, or nil.
Returns true if the result is ok.
Extracts the runtime from any engine result shape.
Returns the status atom: :ok, :wait, or :error.
Returns true if the result is a wait.
Returns the wait configuration, or nil.
Types
Functions
@spec error?(engine_result()) :: boolean()
Returns true if the result is an error.
@spec error_reason(engine_result()) :: term() | nil
Returns the error reason, or nil.
@spec ok?(engine_result()) :: boolean()
Returns true if the result is ok.
@spec runtime(engine_result()) :: map() | nil
Extracts the runtime from any engine result shape.
@spec status(engine_result()) :: :ok | :wait | :error
Returns the status atom: :ok, :wait, or :error.
@spec wait?(engine_result()) :: boolean()
Returns true if the result is a wait.
@spec wait_config(engine_result()) :: term() | nil
Returns the wait configuration, or nil.