View Source Protean.State (Protean v0.0.1)
The Protean machine state.
A %Protean.State{}
struct encompasses the current state of a machine, including its state
configuration (value), the event that triggered a transition to this state, the current context
(extended state), and other private state used internally by Protean.
Additionally, the action callback c:pure/3
receives and returns state to update the context
and schedule side-effects. See Protean.Action
.
Link to this section Summary
Link to this section Types
@opaque private_state()
@type t() :: %Protean.State{ context: context(), event: Protean.event() | nil, private: private_state(), value: value() }
@type value() :: MapSet.t(Protean.Node.id())
Link to this section Functions
Assign data to a state's context.
Usage:
assign(state, key, value)
- Assigns value to key in state's context.assign(state, %{})
- Merges the update map into a state's context.assign(state, enumerable)
- Collects the key/values ofenumerable
into a map, then merges that map into the state's context.
@spec matches?(t(), Protean.Node.id()) :: boolean()
@spec matches?(t(), String.t()) :: boolean()
@spec matches?(t(), atom()) :: boolean()
TODO: Descriptor usage