Spectre.Operation.Result (Spectre v0.3.0)

Copy Markdown View Source

Correlated terminal result of exactly one operational attempt.

Summary

Types

t()

@type t() :: %Spectre.Operation.Result{
  artifacts: [term()],
  attempt_id: String.t(),
  context_revision: non_neg_integer(),
  control_generation: non_neg_integer(),
  epoch: String.t(),
  error: term(),
  fencing_token: String.t(),
  finished_at: non_neg_integer(),
  id: String.t(),
  loop_id: String.t(),
  metadata: map(),
  operation: atom() | String.t(),
  receipt: term(),
  status: :ok | :error | :ambiguous,
  trigger_generation: non_neg_integer(),
  usage: map(),
  value: term()
}

Functions

new(attempt, status, value, opts \\ [])

@spec new(Spectre.Operation.Attempt.t(), :ok | :error | :ambiguous, term(), keyword()) ::
  t()

validate(result)

@spec validate(t()) :: :ok | {:error, term()}

validate!(result)

@spec validate!(t()) :: t()