lattice_presence/state_json

State JSON — serialization and deserialization for the presence CRDT

Provides JSON encoding and decoding of the State type for cross-node replication.

Values

pub fn decoder() -> decode.Decoder(presence_state.State)

Decoder for the CRDT State type. Used by from_json and available for embedding in larger decoders (e.g. sync envelope parsing).

pub fn from_json(
  json_string: String,
) -> Result(presence_state.State, json.DecodeError)

Decode a JSON string into a State

pub fn to_json(s: presence_state.State) -> json.Json

Encode a CRDT State to JSON

pub fn to_json_string(s: presence_state.State) -> String

Encode a State to a JSON string

Search Document