Dsxir.ProgramContext (dsxir v0.4.0)

Copy Markdown

Value type handed to program_plugs at runtime-program construction time.

Plugs resolved from Dsxir.Settings.resolve(:program_plugs, []) see this struct and must return :ok to continue or {:halt, reason} to abort construction with Dsxir.Errors.Halted.ProgramPlug.

Summary

Functions

Build a context for rp. The :metadata opt overrides the value resolved from Dsxir.Settings.resolve(:metadata, %{}); the :caller opt is free-form and defaults to nil.

Types

t()

@type t() :: %Dsxir.ProgramContext{
  caller: term(),
  metadata: map(),
  runtime_program: Dsxir.RuntimeProgram.t()
}

Functions

new(rp, opts \\ [])

@spec new(
  Dsxir.RuntimeProgram.t(),
  keyword()
) :: t()

Build a context for rp. The :metadata opt overrides the value resolved from Dsxir.Settings.resolve(:metadata, %{}); the :caller opt is free-form and defaults to nil.