# `Dllb.Result`
[🔗](https://github.com/Oeditus/dllb_ex/blob/v0.1.0/lib/dllb/result.ex#L1)

Structs representing parsed dllb server responses.

Each struct corresponds to a response status:

  * `Dllb.Result.Ok` - generic success (`{"status":"ok"}`)
  * `Dllb.Result.Created` - record created with an id
  * `Dllb.Result.Deleted` - record deleted, reports whether it existed
  * `Dllb.Result.Rows` - query result with count and data rows
  * `Dllb.Result.Error` - server-side error with a message

# `t`

```elixir
@type t() ::
  Dllb.Result.Ok.t()
  | Dllb.Result.Created.t()
  | Dllb.Result.Deleted.t()
  | Dllb.Result.Rows.t()
  | Dllb.Result.Error.t()
```

# `parse`

```elixir
@spec parse(map()) :: {:ok, t()} | {:error, term()}
```

Converts a decoded JSON map (from `Dllb.Protocol.decode/2`) into the
appropriate result struct by pattern-matching on the `"status"` key.

---

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