Skip to main content

save

Function save 

Source
pub fn save(
    source: &[u8],
    baseline: B3Hash,
    edits: &[TextEdit],
) -> Result<Applied, AxError>
Expand description

Applies a page’s text edits to source, which must be the version baseline, writing each text in that version’s encoding (D11, D12).

§Errors

E_VERSION_CONFLICT when source is not baseline, judged before anything else. E_INVALID_ARGS when the version is not text, when an edit starts or ends inside a character, when the edits are out of order, overlap or reach past the end, and when the result would not read as text in the same encoding. Nothing was applied in any case.