Breeze.Runtime.Context (Breeze v0.5.0)

Copy Markdown View Source

Read-only context passed to a runtime hook.

A context represents one committed runtime lifecycle event. It is intended to be used only during the hook callback; tools should retain values read from it rather than the context itself.

Summary

Functions

Exports opaque runtime state at this lifecycle point.

Returns the terminal frame at this lifecycle point.

Returns the inspector snapshot at this lifecycle point.

Returns metadata for the lifecycle event.

Returns the terminal dimensions at this lifecycle point.

Returns the source server PID.

Returns the root view module.

Types

t()

@opaque t()

Functions

capture_state(context, opts \\ [])

@spec capture_state(
  t(),
  keyword()
) :: {:ok, Breeze.Runtime.State.t()} | {:error, term()}

Exports opaque runtime state at this lifecycle point.

frame(context)

@spec frame(t()) :: map()

Returns the terminal frame at this lifecycle point.

inspector(context)

@spec inspector(t()) :: map()

Returns the inspector snapshot at this lifecycle point.

metadata(context)

@spec metadata(t()) :: map()

Returns metadata for the lifecycle event.

screen(context)

@spec screen(t()) :: map()

Returns the terminal dimensions at this lifecycle point.

server_pid(context)

@spec server_pid(t()) :: pid()

Returns the source server PID.

view(context)

@spec view(t()) :: module()

Returns the root view module.