# `Juggernaut.Routing`
[🔗](https://github.com/holsee/juggernaut/blob/v0.4.0/lib/juggernaut/routing.ex#L1)

Raw, skipped and arid calls (design notes §8.2, §8.4).

  * `raw_calls` - the call is still a site, but the listed argument positions (all
    when none are listed) are never walked: Mutare's `:raw`, used for compile-time
    DSL macros such as `Ecto.Query.from/2`;
  * `skip_calls` - the call, its arguments and the value piped into it are never
    walked: Mutare's `:skip`;
  * arid calls, in the inner lane only and never in core code: `Logger`, `IO` and
    `:telemetry` calls are skipped, the message argument of `raise/1,2` is raw, and
    `arid_calls` are skipped.

An entry is `{Mod, :fun}`, `{Mod, :fun, arity}` or `{Mod, :fun, arity, [positions]}`;
`Mod` (or `:fun`) may be `:*`. A local call matches a module's entry when the module
is imported or `use`d by the enclosing module and the call is not to a function the
module defines itself; only `:*` entries match a call to the module's own function.
Skip entries are checked before raw ones.

# `arid`

```elixir
@type arid() :: boolean() | (module() | nil -&gt; boolean())
```

# `decision`

```elixir
@type decision() :: :walk | :skip | {:raw, :all | [non_neg_integer()]}
```

# `entry`

```elixir
@type entry() ::
  {module() | :*, atom()}
  | {module() | :*, atom(), arity()}
  | {module() | :*, atom(), arity(), [non_neg_integer()]}
```

# `t`

```elixir
@type t() :: %Juggernaut.Routing{
  arid: arid(),
  arid_raw: [entry()],
  arid_skip: [entry()],
  raw: [entry()],
  skip: [entry()]
}
```

# `arid?`

```elixir
@spec arid?(t()) :: boolean()
```

Whether arid calls apply anywhere under `routing`.

# `matches?`

```elixir
@spec matches?(
  entry(),
  Juggernaut.Mutator.Calls.call(),
  Juggernaut.Mutator.Context.t()
) :: boolean()
```

Whether `entry` matches `call` at `ctx`.

# `new`

```elixir
@spec new(keyword(), arid()) :: t()
```

The routing of a run: `raw_calls`, `skip_calls` and `arid_calls` from `opts`. Arid
calls apply where `arid` says: `true` or `false` for the whole file, or a function of
the enclosing module (inner lane: true outside core, whether core is given as files
or as modules).

# `route`

```elixir
@spec route(t(), Juggernaut.Mutator.Calls.call(), Juggernaut.Mutator.Context.t()) ::
  {decision(), entry() | nil}
```

The routing decision for a resolved call, and the entry that decided it.

# `without_arid`

```elixir
@spec without_arid(t()) :: t()
```

`routing` with arid calls turned off: the gate lane's routing of the same file.

---

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