Expand description
Terminal rendering for DIDs and their display names.
The naming logic itself lives in vta_sdk::display_name — this module is
the thin CLI layer on top: ANSI colour, ratatui cells, and the decision
about whether a table gets a NAME column at all.
§Usage
A command builds a NameBook from the response it already has, then
renders through it:
ⓘ
let mut book = NameBook::new();
book_from_acl(&mut book, &resp.entries); // one pass, no extra requests
let show_names = book.names_any(resp.entries.iter().map(|e| e.did.as_str()));The book_from_* helpers are the payoff: filling the book from an ACL
listing also names the Created By column, because a granting admin is
very often another entry’s subject. No lookup, no round trip.
Structs§
- Display
Name - A name for a DID, and the provenance of that name.
- Name
Book - A
DID → namemap, populated by the caller from data it already holds.
Enums§
- Name
Source - Where a display name came from.
Constants§
- NAME_
HEADER - Column heading for the name column. One constant so every table agrees.
- UNNAMED
- Placeholder for a row with no name, used only when some other row in the same table has one.
Functions§
- book_
from_ acl - Fill
bookfrom an ACL listing. - book_
from_ contexts - Fill
bookfrom a context listing: each context’snamenames its DID. - book_
from_ vta - Best-effort book from the two listings that name DIDs on a VTA: the ACL (subject labels) and the contexts (each context’s name, for its own DID).
- book_
from_ webvh_ servers - Fill
bookfrom a webvh hosting-server listing. - did_
cell - A DID rendered for a fixed-width table cell: shortened, dimmed.
- full_
display_ pairs - Key-value pairs for a
--full-displayblock: aNameline above theDIDline, and the DID in full — abbreviating it is the one thing full display exists to avoid. - inline
- One-line rendering for prose, confirmations and progress messages:
mediator-prod (did:webvh:QmXk…9f2:example.com). - name_
cell - A name cell for
did. - name_
or_ did - Plain-text name-or-DID for a fixed-width column.
- named_
did_ cell - A cell for a DID that may carry a name — used where a column holds a
reference to some other principal (
Created By,Actor, a sender) rather than the row’s own subject, so there is no room for a paired name column. Falls back to the shortened DID. - resolve_
agent_ names - Whether agent-name resolution was requested.
- resolve_
agent_ names_ into - Without the
agent-namesfeature there is nothing to resolve. - set_
resolve_ agent_ names - Register the operator’s
--resolve-agent-nameschoice. Called once at CLI startup. - shorten_
did - Shorten a DID for a fixed-width cell while keeping the part that identifies it.