Skip to main content

add_item

Function add_item 

Source
pub fn add_item(
    workload_path: &Path,
    anchor: &Anchor,
    group: &str,
    item: &ReportItem,
    replace: bool,
) -> Result<AddOutcome>
Expand description

Promote item into the workload at anchor’s report: block, in group. Returns AddOutcome::Inserted if the item was new; AddOutcome::Replaced if replace=true and the item pre-existed.

Collision policy:

  • Item name already exists at anchor’s report block, replace=false ⇒ error with the existing location.
  • Item name exists elsewhere in the workload (different anchor), replace=false ⇒ error pointing at that location and recommending --rename or --at <other>.
  • replace=true overwrites the existing entry at its existing site (anchor isn’t moved on replace).