View Source TimeZoneInfo.DataPersistence behaviour (TimeZoneInfo v0.7.2)

A behaviour to persist the data.

Summary

Callbacks

Returns the checksum for the persisted data.

Returns the persisted data.

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

Returns infos about the persisted data.

Persists the given data.

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

Callbacks

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

Returns the checksum for the persisted data.

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

Returns the persisted data.

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

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

@callback info() :: term()

Returns infos about the persisted data.

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

Persists the given data.

@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.