telega/storage/ets

ETS-backed KeyValueStorage with lazy TTL expiration.

Values live in a public, named ETS table for the lifetime of the VM but do NOT survive a VM restart. TTL is enforced lazily: an expired entry is only removed when it is next accessed via get or scan. For persistence across restarts use a database-backed package (Postgres/SQLite/Redis).

Values

pub fn new(
  name name: String,
) -> Result(storage.KeyValueStorage(error), error.TelegaError)

Create an ETS-backed KeyValueStorage.

name is the ETS table name; reusing the same name returns a handle to the existing table. The error type stays generic because none of the operations can fail, so the result composes with flows/sessions of any error type.

Search Document