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

One replacement at one site (design notes §6, §14.1).

`key` is the canonical key (the cache and triage key); `id` is the short id shown
everywhere. `switch` is run-local: the integer that turns this mutant on in its
compiled metamutant, `nil` until schemata are built. `location` positions are
`{line, column}`, 1-based, in the original source. `diff` is a unified diff of the
original file text.

# `ignore`

```elixir
@type ignore() :: %{
  prefix: String.t(),
  scope: :line | :region | :file,
  filter: [String.t()],
  reason: String.t(),
  line: pos_integer()
}
```

# `location`

```elixir
@type location() :: %{
  start: {pos_integer(), pos_integer()},
  end: {pos_integer(), pos_integer()}
}
```

# `position`

```elixir
@type position() :: :runtime | :pattern | :guard
```

# `t`

```elixir
@type t() :: %Juggernaut.Mutant{
  category: atom(),
  clause: non_neg_integer(),
  core?: boolean(),
  diff: String.t(),
  file: String.t(),
  function: {atom(), arity()},
  id: String.t(),
  ignore: ignore() | nil,
  key: String.t(),
  location: location(),
  module: module(),
  operator: atom(),
  original: String.t(),
  path: [non_neg_integer()],
  position: position(),
  replacement: String.t(),
  switch: pos_integer() | nil,
  variant: String.t() | nil
}
```

# `line`

```elixir
@spec line(t()) :: pos_integer()
```

The line the mutant starts on.

# `mfa`

```elixir
@spec mfa(t()) :: String.t()
```

`Module.fun/arity` of the function the mutant is in, without the `Elixir.` prefix.

# `positions`

```elixir
@spec positions() :: [position()]
```

The positions a site can be in.

---

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