Behaviour for annotation persistence backends.
An adapter turns the in-memory annotation list into durable storage and back.
The default is Annotai.Persistence.Adapter.File (an ETF snapshot of the whole
set); the behaviour is the seam for alternative backends (e.g. a database) and
for a fake adapter in tests.
config is the normalized persistence config (a map) — each adapter reads only
the keys it cares about.
Summary
Callbacks
Load all persisted annotations. Absent storage returns {:ok, []}.
Persist annotations, replacing any previously stored set.
Types
@type config() :: map()
Normalized persistence config; adapters pick the keys they need.
Callbacks
@callback load(config()) :: {:ok, [Annotai.Annotation.t()]} | {:error, term()}
Load all persisted annotations. Absent storage returns {:ok, []}.
@callback save([Annotai.Annotation.t()], config()) :: :ok | {:error, term()}
Persist annotations, replacing any previously stored set.