# `VerifiedPubSub.Info`
[🔗](https://github.com/CuriousCurmudgeon/verified_pubsub/blob/v0.1.0/lib/verified_pubsub/info.ex#L1)

The only supported way to read a manifest.

Read a manifest through these functions, not through the Spark internals, so that the
DSL stays replaceable.

# `events`

```elixir
@spec events(module(), atom()) :: [atom()]
```

Returns the events that a topic declares, in the order of declaration.

# `fields`

```elixir
@spec fields(module(), atom(), atom()) :: [VerifiedPubSub.Dsl.Field.t()]
```

Returns the fields that an event declares, in the order of declaration.

# `match`

```elixir
@spec match(module(), String.t()) ::
  {:ok, atom(), %{required(atom()) =&gt; String.t()}} | :error
```

Finds the declared topic that a wire topic belongs to, and the params that it carries.

    iex> VerifiedPubSub.Info.match(MyApp.Topics, "owners:42:pets")
    {:ok, :pets, %{owner_id: "42"}}

It does the reverse of `VerifiedPubSub.Api.topic/2`, for a string from a log, a trace,
or `Phoenix.PubSub`. Param values come back as the strings that were on the wire.
Returns `:error` when no topic matches, and when a param segment is empty, which no
broadcast can produce.

# `params`

```elixir
@spec params(module(), atom()) :: [atom()]
```

Returns the params of a topic, in the order of its segments.

# `topic`

```elixir
@spec topic(module(), atom()) :: {:ok, VerifiedPubSub.Dsl.Topic.t()} | :error
```

Fetches a topic by its name.

# `topic!`

```elixir
@spec topic!(module(), atom()) :: VerifiedPubSub.Dsl.Topic.t()
```

Fetches a topic by its name, and raises with the known topics when it is absent.

# `topics`

```elixir
@spec topics(dsl_or_extended :: module() | map()) :: [struct()]
```

topics DSL entities

---

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