Versioned contract implemented by packages that can be installed in a Stack.
manifest/0 and compile/3 run while the Stack definition is compiled and
must return immutable data. child_specs/2, when implemented, runs only
when a caller explicitly starts Spectre.Stack.Runtime.
Summary
Functions
Defines a static manifest and default data-only compiler.
Returns the supported installable contract version.
Verifies and returns an installable package manifest.
Verifies an installable or raises with a stable contract error.
Callbacks
@callback child_specs( Spectre.Stack.Installation.t(), keyword() ) :: [{term(), Supervisor.child_spec()}] | {:ok, [{term(), Supervisor.child_spec()}]} | {:error, term()}
@callback manifest() :: Spectre.Stack.Package.t() | map() | keyword()
Functions
Defines a static manifest and default data-only compiler.
@spec contract_version() :: pos_integer()
Returns the supported installable contract version.
@spec verify(module(), pos_integer()) :: {:ok, Spectre.Stack.Package.t()} | {:error, term()}
Verifies and returns an installable package manifest.
@spec verify!(module(), pos_integer()) :: Spectre.Stack.Package.t()
Verifies an installable or raises with a stable contract error.