MCPcopy Create free account
hub / github.com/argumentcomputer/ix / to_unique_name

Method to_unique_name

crates/common/src/address.rs:63–69  ·  view source on GitHub ↗

Build a deterministic, collision-resistant `Name` for this address: `Ix._#. `. Mirrors Lean-side `Ix.Address.toUniqueName`. Use this when you need to register a KId/Named entry at a synthetic name that can't collide with any Lean-originated name (e.g. for scratch `KEnv` entries that should not participate in the `name_to_addr` / `aux_name_to_addr` namespace).

(&self)

Source from the content-addressed store, hash-verified

61 /// scratch `KEnv` entries that should not participate in the
62 /// `name_to_addr` / `aux_name_to_addr` namespace).
63 pub fn to_unique_name(&self) -> crate::env::Name {
64 use crate::env::Name;
65 Name::str(
66 Name::str(Name::str(Name::anon(), "Ix".to_string()), "_#".to_string()),
67 self.hex(),
68 )
69 }
70
71 /// Inverse of `to_unique_name`. Returns `Some(Address)` iff `name` has
72 /// shape `Ix._#.<hex>` with valid 64-char hex; otherwise `None`.

Callers

nothing calls this directly

Calls 1

hexMethod · 0.80

Tested by

no test coverage detected