Skip to main content

backfill

Function backfill 

Source
pub fn backfill(
    body: &str,
    doc_id: &str,
    existing_ids: &HashSet<String>,
) -> (String, bool)
Expand description

Lazy backfill: ensure every item has a hash id and a checkbox.

  • Items missing a hash get a new one (guaranteed unique within the component).
  • Checkboxes are normalized (default [ ]).
  • Returns (new_body, changed). changed = false when the body was already canonical.