Get the next intent ID and advance the counter. Returns a string like "PIMO-1", "ATOM-42". Legacy (pre-ULID) allocation. New intents use [`allocate_author_seq`](Self::allocate_author_seq) + [`compose_human_key`](Self::compose_human_key) and a ULID primary id.
(&mut self)
| 347 | /// [`allocate_author_seq`](Self::allocate_author_seq) + |
| 348 | /// [`compose_human_key`](Self::compose_human_key) and a ULID primary id. |
| 349 | pub fn allocate_intent_id(&mut self) -> String { |
| 350 | let id = self.next_intent_id; |
| 351 | self.next_intent_id = id.saturating_add(1); |
| 352 | let prefix = if self.intent_prefix.is_empty() { |
| 353 | "VAULT" |
| 354 | } else { |
| 355 | &self.intent_prefix |
| 356 | }; |
| 357 | format!("{}-{}", prefix, id) |
| 358 | } |
| 359 | |
| 360 | /// The project code used in human keys (falls back to `VAULT`). |
| 361 | pub fn project_code(&self) -> &str { |