pub enum NameSource {
AgentName {
verified: bool,
},
AclLabel,
DeviceName,
LocalAlias,
ServerLabel,
ContextName,
}Expand description
Where a display name came from.
Kept as a distinct type rather than folding everything into a String
because the sources are not equally trustworthy, and the difference has to
survive all the way to the pixel — see the module-level note on trust.
Variants§
AgentName
An alsoKnownAs entry on the DID’s own document.
verified means the name was resolved forward and led back to this
same DID. verified == false is a bare self-assertion and is the
least trustworthy source there is.
AclLabel
AclEntry.label / VtcAclEntry.label — operator-typed, our store.
DeviceName
A DeviceBinding.display_name from an agent device registration.
LocalAlias
The name of a locally-configured VTA / community (~/.config/{pnm,cnm}).
ServerLabel
WebvhServerRecord.label — names a DID-hosting server.
ContextName
ContextRecord.name — names a context, used for the context’s own DID.
Implementations§
Source§impl NameSource
impl NameSource
Sourcepub fn rank(self) -> u8
pub fn rank(self) -> u8
Precedence when two sources name the same DID. Higher wins.
A verified agent name outranks everything: it is globally meaningful and cryptographically bound to the DID, where a local label is one operator’s private note. An unverified agent name ranks below every local source for the reason in the module docs — the operator’s own data must never be displaced by a stranger’s unchecked claim.
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Stable machine-readable tag, used for the nameSource field in
--json output. Kebab-case so it reads well through jq.
Sourcepub fn is_trusted(self) -> bool
pub fn is_trusted(self) -> bool
Whether a name from this source may be shown without qualification.
False only for an unverified agent name.
Trait Implementations§
Source§impl Clone for NameSource
impl Clone for NameSource
Source§fn clone(&self) -> NameSource
fn clone(&self) -> NameSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more