Learn R Programming

automerge (version 0.3.0)

am_sync_state_encode: Serialize a sync state

Description

Encodes a sync state to a raw vector for persistence or transmission. The encoded state can later be restored with am_sync_state_decode().

Usage

am_sync_state_encode(sync_state)

Value

A raw vector containing the serialized sync state.

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.

See Also

am_sync_state_decode(), am_sync_state()

Examples

Run this code
sync_state <- am_sync_state()

# Encode for storage
bytes <- am_sync_state_encode(sync_state)
bytes

# Restore later
restored <- am_sync_state_decode(bytes)
restored

Run the code above in your browser using DataLab