spoke/core/ets_storage

Provides ETS-backed session storage on the Erlang target.

Types

Any error coming from ETS directly, type not specified.

pub type EtsError

A handle to the ETS table storing the session state.

pub type EtsStorage

Values

pub fn delete(storage: EtsStorage) -> Nil

Deletes the associated ETS table.

pub fn load_from_file(
  filename: String,
) -> Result(EtsStorage, EtsError)

Loads a session previously stored to a file using store_to_file.

pub fn new() -> EtsStorage

Create a new empty ETS storage.

pub fn read(storage: EtsStorage) -> session_state.SessionState

Reads the currently stored session state.

pub fn store_to_file(
  storage: EtsStorage,
  filename: String,
) -> Result(Nil, EtsError)

Stores the ETS table to a file, using Erlang’s serialization.

pub fn update(
  storage: EtsStorage,
  what: session_state.StorageUpdate,
) -> Nil

Updates the state of the storage.

Search Document