Oi.Result (oi v0.8.0)

Copy Markdown

Execution result: the final drafting memory.

memory is keyed by Orchid io_key, values are Orchid.Param.t().

status is :complete when every stage ran, or :halted when a :checkpoint function stopped the dispatch early — in that case halted_at holds the index of the stage that was not executed and memory holds everything produced up to that point.

Summary

Types

t()

@type t() :: %Oi.Result{
  halted_at: non_neg_integer() | nil,
  memory: %{required(Orchid.Step.io_key()) => Orchid.Param.t()},
  status: :complete | :halted
}

Functions

fetch(result, key)

@spec fetch(t(), Orchid.Step.io_key()) ::
  {:ok, Orchid.Param.t()} | {:error, :not_found}

new(memory, opts \\ [])

@spec new(
  %{required(Orchid.Step.io_key()) => Orchid.Param.t()},
  keyword()
) :: t()

reify(res, key)

@spec reify(t(), Orchid.Step.io_key()) :: {:ok, term()} | {:error, :not_found}