# `TimeZoneInfo.DataPersistence`
[🔗](https://github.com/hrzndhrn/time_zone_info/blob/main/lib/time_zone_info/data_persistence.ex#L1)

A behaviour to persist the data.

# `checksum`

```elixir
@callback checksum() :: {:ok, binary()} | {:error, :no_data} | {:error, term()}
```

Returns the checksum for the persisted data.

# `fetch`

```elixir
@callback fetch() :: {:ok, TimeZoneInfo.data()} | {:error, term()}
```

Returns the persisted data.

# `fetch_last_update`

```elixir
@callback fetch_last_update() :: {:ok, non_neg_integer()} | {:error, term()}
```

Returns the timestamp of the last update in seconds since epoch.

# `info`
*optional* 

```elixir
@callback info() :: term()
```

Returns infos about the persisted data.

# `put`

```elixir
@callback put(TimeZoneInfo.data()) :: :ok | {:error, term()}
```

Persists the given data.

# `put_last_update`

```elixir
@callback put_last_update(time :: non_neg_integer()) :: :ok | {:error, term()}
```

Sets `time` as last update time stamp. `time` is given in seconds since epoch.

---

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