# `PhoenixDevToolbar.Context`
[🔗](https://github.com/zoten/phoenix_dev_toolbar/blob/0.0.2/lib/phoenix_dev_toolbar/context.ex#L1)

What a plugin's `c:PhoenixDevToolbar.Plugin.collect/3` knows about the event
it is handling ([ADR 05](https://github.com/zoten/phoenix_dev_toolbar/blob/main/adr/05-plugin-behaviour.md)).

  * `sid`: the page session the event belongs to
  * `source`: `:self` when the emitting process is tracked itself (a request,
    a LiveView), `:caller` for its `$callers` children such as `Task.async`
  * `config`: the plugin's config, as returned by its `init/1`
  * `span`: the callback span the event happened in: a counter bumped at
    every LiveView callback start and stop in the tracked process (so one
    `handle_event/3`, one `render/1`, or the gap between two callbacks where
    `handle_info/2` runs). A `$callers` child gets its caller's span. Events
    are stamped with it (`Event.span`).

# `source`

```elixir
@type source() :: :self | :caller
```

# `t`

```elixir
@type t() :: %PhoenixDevToolbar.Context{
  config: term(),
  sid: String.t(),
  source: source(),
  span: non_neg_integer()
}
```

---

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