# `Lotus.Visibility.Matcher`
[🔗](https://github.com/elixir-lotus/lotus/blob/v1.2.0/lib/lotus/visibility/matcher.ex#L1)

The compiled form of a visibility rule set.

`Lotus.Visibility.compile/2` turns the schema, table and column rules a
resolver returns into one of these, once. Exact names go into sets, regex
rules into short ordered lists, and the built-in denies of the source's
adapter are merged into the deny sets. Every check in `Lotus.Visibility`
then runs against the compiled form instead of walking the raw rules.

The struct is opaque to callers. Build it with `Lotus.Visibility.compile/2`
and pass it to the `Lotus.Visibility` check functions. Precedence and
matching are exactly those documented in `Lotus.Visibility`.

# `column_rules`

```elixir
@type column_rules() :: %{
  schema_table: [{term(), term(), term(), term()}],
  table: [{term(), term(), term()}],
  exact: %{required(String.t()) =&gt; {non_neg_integer(), term()}},
  patterns: [{non_neg_integer(), term(), term()}]
}
```

# `name_set`

```elixir
@type name_set() :: %{exact: MapSet.t(String.t()), patterns: [Regex.t()]}
```

# `t`

```elixir
@type t() :: %Lotus.Visibility.Matcher{
  column: column_rules(),
  schema_allow: :all | name_set(),
  schema_deny: name_set(),
  table_allow: table_allow(),
  table_deny: table_set()
}
```

# `table_allow`

```elixir
@type table_allow() ::
  :all
  | %{
      applies_to_all?: boolean(),
      schemas: name_set(),
      nil_schema?: boolean(),
      rules: table_set()
    }
```

# `table_set`

```elixir
@type table_set() :: %{
  exact: MapSet.t({String.t() | nil, String.t()}),
  bare: MapSet.t(String.t()),
  patterns: [{term(), term()}]
}
```

---

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