# `ExGram.Router.Scope`
[🔗](https://github.com/rockneurotiko/ex_gram_router/blob/v0.1.0/lib/ex_gram/router/scope.ex#L1)

Internal data structure representing a node in the routing tree.

A scope is either:
- A **leaf**: has a handler (and optionally filters), no children.
- A **branch**: has filters and children scopes, no handler.

Scopes are built at compile time by the DSL macros and stored as a nested
structure. At runtime, the dispatcher walks this tree top-to-bottom to find
the first matching handler.

# `filter`

```elixir
@type filter() :: {module(), term()}
```

# `handler`

```elixir
@type handler() ::
  {module(), atom(), 1 | 2}
  | (ExGram.Cnt.t() -&gt; ExGram.Cnt.t())
  | (term(), ExGram.Cnt.t() -&gt; ExGram.Cnt.t())
```

# `t`

```elixir
@type t() :: %ExGram.Router.Scope{
  children: [t()],
  filters: [filter()],
  handler: handler() | nil
}
```

# `leaf?`

Returns true if the scope is a leaf node (has a handler and no children).

---

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