# `AshCache.Store.Adapter`
[🔗](https://github.com/Undeadlol1/ash_cache/blob/v0.1.0/lib/ash_cache/store/adapter.ex#L1)

Behaviour every AshCache storage adapter implements.

Deliberately the plainest possible key/value contract, so an adapter
already written against another cache facade ports one-to-one. A miss is
`{:ok, nil}`, never an error tuple.

# `clear`

```elixir
@callback clear(store :: atom()) :: :ok | {:error, term()}
```

# `delete`

```elixir
@callback delete(store :: atom(), key :: term()) :: :ok | {:error, term()}
```

# `get`

```elixir
@callback get(store :: atom(), key :: term()) :: {:ok, term()} | {:error, term()}
```

# `put`

```elixir
@callback put(store :: atom(), key :: term(), value :: term(), opts :: keyword()) ::
  :ok | {:error, term()}
```

Stores a value. Recognised options:

  * `:ttl` — milliseconds, or `:infinity`
  * `:never_evict` — exempt this entry from any capacity bound the adapter
    enforces. For metadata an adapter must not drop on its own, such as
    the version counters cache invalidation reads. Adapters without a
    bound ignore it.

---

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