Skip to main content

commit_edit_from

Function commit_edit_from 

Source
pub async fn commit_edit_from<E>(
    store: &dyn ObjectStore,
    cfg: &LeanConfig,
    flush: &str,
    first: Option<Option<Arc<LoadedManifest>>>,
    edit: impl Fn(Option<&LoadedManifest>, &mut LeanManifest) -> Result<(), E>,
) -> Result<(), EditError<E>>
Expand description

commit_edit, whose FIRST attempt edits first — a document the caller loaded at the pointer it just read (the gateway’s view, keyed by the pointer’s etag) — instead of loading it again. Some(None): the caller found no document. Safe because the CAS is If-Match on that document’s etag: an attempt over a document that has since moved loses, and every later attempt loads the current one.