# `Snodo.Envelope`
[🔗](https://github.com/joshrotenberg/snodo/blob/v0.1.0/lib/snodo/envelope.ex#L1)

A decoded JSON-RPC message before dialect-specific resolution.

# `id`

```elixir
@type id() :: String.t() | integer() | nil
```

# `t`

```elixir
@type t() :: %Snodo.Envelope{
  id: id(),
  kind: :request | :notification,
  method: String.t(),
  params: map(),
  raw: map(),
  transport: Snodo.Transport.Context.t()
}
```

# `decode`

```elixir
@spec decode(term(), Snodo.Transport.Context.t()) ::
  {:ok, t()} | {:error, Snodo.Error.t()}
```

Decodes the protocol-neutral JSON-RPC envelope without choosing a dialect.

# `notification?`

```elixir
@spec notification?(term()) :: boolean()
```

Whether a decoded JSON value identifies itself as a notification: a string
`method` and no `id`. JSON-RPC forbids replying to one, even when it is
otherwise malformed.

# `response?`

```elixir
@spec response?(term()) :: boolean()
```

Whether a decoded JSON value is a JSON-RPC response object: no `method`,
and a `result` or `error` member. A server has nothing to answer to one.

---

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