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 moreimpl Copy for NameSource
Source§impl Debug for NameSource
impl Debug for NameSource
impl Eq for NameSource
Source§impl PartialEq for NameSource
impl PartialEq for NameSource
Source§impl Serialize for NameSource
impl Serialize for NameSource
Source§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl StructuralPartialEq for NameSource
Auto Trait Implementations§
impl Freeze for NameSource
impl RefUnwindSafe for NameSource
impl Send for NameSource
impl Sync for NameSource
impl Unpin for NameSource
impl UnsafeUnpin for NameSource
impl UnwindSafe for NameSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T.