Skip to main content

record_state

Function record_state 

Source
pub fn record_state(
    fs: &impl Fs,
    paths: &StorePaths,
    clock: &impl Clock,
    _rng: &impl Rng,
    doc_id: &str,
    content: &[u8],
    op_kind: Option<&str>,
) -> Result<RecordOutcome, SessionError>
Expand description

Record the current content as a new state snapshot for doc_id.

op_kind is an optional label (e.g. “edit”, “external”) stored on the record; it does NOT affect undo/redo. Returns Unchanged if content is byte-identical to the current HEAD snapshot (dedup), else Recorded { id } with HEAD advanced and the redo stack cleared.