MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / allocate_intent_id

Method allocate_intent_id

atomic-core/src/pristine/vault.rs:326–335  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

324 /// [`allocate_author_seq`](Self::allocate_author_seq) +
325 /// [`compose_human_key`](Self::compose_human_key) and a ULID primary id.
326 pub fn allocate_intent_id(&mut self) -> String {
327 let id = self.next_intent_id;
328 self.next_intent_id = id.saturating_add(1);
329 let prefix = if self.intent_prefix.is_empty() {
330 "VAULT"
331 } else {
332 &self.intent_prefix
333 };
334 format!("{}-{}", prefix, id)
335 }
336
337 /// The project code used in human keys (falls back to `VAULT`).
338 pub fn project_code(&self) -> &str {

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected