Function yrs::ytransaction_encode_state_from_snapshot_v2

source ·
#[no_mangle]
pub unsafe extern "C" fn ytransaction_encode_state_from_snapshot_v2(
    txn: *const Transaction,
    snapshot: *const c_char,
    snapshot_len: u32,
    len: *mut u32
) -> *mut c_char
Expand description

Encodes a state of the document at a point in time specified by the provided snapshot (generated by: ytransaction_snapshot). This is useful to generate a past view of the document.

The returned update is binary compatible with Yrs update lib0 v2 encoding, and can be processed with functions dedicated to work on it, like ytransaction_apply_v2.

This function requires document with a GC option flag turned off (otherwise “time travel” would not be a safe operation). If this is not a case, the NULL pointer will be returned.