Encodes a sync state to a raw vector for persistence or transmission.
The encoded state can later be restored with am_sync_state_decode().
Arguments
- sync_state
A sync state object (created with
am_sync_state())
Details
This is useful for persisting sync progress across sessions, avoiding the need to re-sync from scratch.
Examples
sync_state <- am_sync_state()
# Encode for storage
bytes <- am_sync_state_encode(sync_state)
bytes
#> [1] 43 00
# Restore later
restored <- am_sync_state_decode(bytes)
restored
#> <Automerge Sync State>