# `Obscura.Operator.Custom`
[🔗](https://github.com/hfiguera/obscura/blob/v0.2.0/lib/obscura/operator/custom.ex#L1)

Behaviour and guarded runtime for application-defined anonymizer operators.

Custom operators receive the source value, safe anonymizer context, and the
configured options map. They must return `{:ok, replacement}` or
`{:ok, replacement, metadata}` with a binary replacement and map metadata.

# `callback_result`

```elixir
@type callback_result() ::
  {:ok, String.t()} | {:ok, String.t(), map()} | {:error, term()}
```

Accepted custom operator callback return contract.

# `context`

```elixir
@type context() :: %{entity: atom()}
```

Sanitized anonymizer context supplied to a custom operator.

# `options`

```elixir
@type options() :: map()
```

Application-defined options from the operator configuration.

# `apply`

```elixir
@callback apply(String.t(), context(), options()) :: callback_result()
```

---

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