# `Nerves.Runtime.KVBackend`
[🔗](https://github.com/nerves-project/nerves_runtime/blob/v0.13.13/lib/nerves_runtime/kv_backend.ex#L4)

Behaviour for customizing the Nerves Runtime's key-value store

# `load`

```elixir
@callback load(options :: keyword()) ::
  {:ok, contents :: Nerves.Runtime.KV.string_map()} | {:error, reason :: any()}
```

Load the KV store and return its contents

This will be called on boot and should return all persisted key/value pairs.
The results will be cached and if a change should be persisted, `c:save/2` will
be called with the update.

# `save`

```elixir
@callback save(contents :: Nerves.Runtime.KV.string_map(), options :: keyword()) ::
  :ok | {:error, reason :: any()}
```

Persist the updated KV pairs

The KV map contains the KV pairs returned by `c:load/1` with any changes made
by users of `Nerves.Runtime.KV`.

---

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