Macaw.State.Snapshot (macaw v0.6.0)

Copy Markdown View Source

A state snapshot (spec/03 §4): the current value of every state source of a surface that persists and isn't declared snapshot: false, in the shape of a record's state events (spec/08), each a state and its value, with no instance, time, initiator or identity. It carries no identity of whoever took it, so it restores for whoever restores it.

Each value is its text, as persistence writes it (spec/03 §3.2), so a snapshot is plain data: strings, and maps of strings, that a host saves as it likes, alone or in a bundle. Macaw.State.snapshot/1 takes one and Macaw.State.restore_snapshot/2 restores it, judging each value as untrusted input.

Summary

Types

One state's value: its name and its text.

t()

Types

entry()

@type entry() :: %{
  state: String.t(),
  value: String.t() | %{required(String.t()) => String.t()}
}

One state's value: its name and its text.

t()

@type t() :: %Macaw.State.Snapshot{states: [entry()], surface: String.t()}