View Source Protean.State (Protean v0.1.0-alpha.0)

Snapshot of active states, context, and the latest event seen by the machine.

This module is rarely interacted with directly. Instead, use the API exposed by the top-level Protean, such as Protean.matches?/2, or actions exposed by Protean.Action.

Link to this section Summary

Link to this section Types

@type context() :: %{required(any()) => any()}
Link to this opaque

private_state()

View Source (opaque)
@opaque private_state()
@type t() :: %Protean.State{
  context: context(),
  event: Protean.event() | nil,
  final: value(),
  private: private_state(),
  value: value()
}
@type value() :: MapSet.t(Protean.Node.id())

Link to this section Functions

@spec assign(t(), %{required(any()) => any()}) :: t()
@spec assign(t(), Enumerable.t()) :: t()
Link to this function

matches?(state, descriptor)

View Source
@spec matches?(t(), Protean.Node.id()) :: boolean()
@spec matches?(t(), String.t()) :: boolean()
@spec matches?(t(), atom()) :: boolean()