View Source Protean.Guard protocol (Protean v0.1.0-alpha.1)
Protocol for guarded transitions, actions, etc.
Default implementations are provided for:
BitString
- Call callback module with string, context, and eventAtom
- Call callback module with atom, context, and eventFunction
- Call function with context and eventTuple
- Higher-order guard utilities:{:and, [guard1, ...]}
{:or, [guard1, ...]}
{:not, guard}
{:in, query}
- Delegates toProtean.Context.matches?/2
Link to this section Summary
Link to this section Types
@type guard() :: term()
Implements Protean.Guard
protocol.
@type t() :: term()
Link to this section Functions
@spec allows?(t(), Protean.Context.t(), Protean.event(), callback_module :: module()) :: boolean()