# `Spectre.Flow.Constraint`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/flow/constraint.ex#L1)

Namespaced constraint contributed to a compiled flow by an extension.

Source constraints participate in routing. Other kinds remain attached to
the selected rule so inference or workflow extensions can consume them
without affecting route visibility.

# `t`

```elixir
@type t() :: %Spectre.Flow.Constraint{
  kind: :source | :inference | atom(),
  metadata: map(),
  mode: :any | :all,
  namespace: atom() | String.t(),
  values: [term()]
}
```

# `filter_and_order`

```elixir
@spec filter_and_order([Spectre.Rule.t()], Spectre.Input.t()) :: [Spectre.Rule.t()]
```

Filters incompatible rules and prefers constrained rules inside the existing
global-interrupt and ordinary-rule precedence groups.

# `match?`

```elixir
@spec match?([t()], Spectre.Input.t()) :: boolean()
```

Returns whether a rule's source constraints accept an input.

# `new`

```elixir
@spec new(t() | map() | keyword()) :: t()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
