Yex.Snapshot (y_ex v0.12.1)

Copy Markdown View Source

Opaque snapshot of a document state at a specific point in time.

Use Yex.snapshot/1 to create it and encode_state_v1/1 or encode_state_v2/1 to generate time-travel updates.

Summary

Functions

Encodes document state represented by this snapshot in lib0 v1 format.

Encodes document state represented by this snapshot in lib0 v2 format.

Types

t()

@type t() :: %Yex.Snapshot{doc: Yex.Doc.t(), reference: binary()}

Functions

encode_state_v1(snapshot)

@spec encode_state_v1(t()) :: {:ok, binary()} | {:error, term()}

Encodes document state represented by this snapshot in lib0 v1 format.

encode_state_v2(snapshot)

@spec encode_state_v2(t()) :: {:ok, binary()} | {:error, term()}

Encodes document state represented by this snapshot in lib0 v2 format.