Skip to main content

NameSource

Enum NameSource 

Source
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.

Fields

§verified: bool
§

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

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> NameSource

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for NameSource

Source§

impl Debug for NameSource

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for NameSource

Source§

impl PartialEq for NameSource

Source§

fn eq(&self, other: &NameSource) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for NameSource

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for NameSource

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.