Guard

works.iterative.workflow.Guard
See theGuard companion object
sealed trait Guard[R, S]

A composable guard over entity state S.

Each guard carries:

  • describe — a renderable GuardDescription tree (consumed by diagram export)
  • check — a pure evaluation against a GuardContext

The describe tree mirrors the evaluation structure:

  • AndAll (flattened, matching And.check's flat Conjunction accumulation)
  • OrAny (node-level, matching Or.check's node-level Disjunction)

Structural mirroring guarantees the description cannot contradict evaluation.

Combinators:

  • and: accumulates all failing branches flatly into GuardFailure.Conjunction
  • or: node-level; if both branches fail, wraps them in GuardFailure.Disjunction

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class And[R, S]
class Invalid[R, S]
class Or[R, S]
class RequireIdentity[R, S]
class RequireRole[R, S]
class Requirement[R, S]
Show all

Members list

Value members

Abstract methods

def check(ctx: GuardContext[R, S]): Either[GuardFailure, Unit]

Concrete methods

infix def and(that: Guard[R, S]): Guard[R, S]
infix def or(that: Guard[R, S]): Guard[R, S]