pub struct ItemInterner { /* private fields */ }Expand description
Per-category name -> ItemId interner used while importing rows: dimension
values are looked up (reusing an existing item of that name) or minted a
fresh sequential id. Seed from the model’s current items so re-import /
refresh reuses items instead of creating duplicates with the same name.
Implementations§
Source§impl ItemInterner
impl ItemInterner
Sourcepub fn seeded_from(model: &Model, item_id_base: u32) -> Self
pub fn seeded_from(model: &Model, item_id_base: u32) -> Self
Seed the interner from model’s existing items. Minted ids start at
item_id_base, but never below max(existing item id) + 1: on a repeat
import the caller passes the same fixed base (the GUI wizard always
passes 1_000_000), so allocating straight from the base would re-mint an
id a differently named item already owns — register then keeps the
old name and the new row’s value silently lands under the wrong label.
Allocating above the model’s maximum guarantees freshness while the base
still acts as the floor for a fresh import.