pub struct Passport { /* private fields */ }Expand description
The traveler’s held Passport: the token, its claims, and (once fetched)
the descriptor. Fetching runs on a background thread; call Passport::poll
once per frame, like the other Loom clients.
Implementations§
Source§impl Passport
impl Passport
Sourcepub fn from_token(token: impl Into<String>) -> Option<Self>
pub fn from_token(token: impl Into<String>) -> Option<Self>
Hold a token. Claims decode best-effort — an opaque (non-JWT) dev token
still carries, it just has no readable claims. Empty tokens are None:
no passport is a valid, anonymous way to walk.
Sourcepub fn from_env() -> Option<Self>
pub fn from_env() -> Option<Self>
The traveler’s passport from INFINITE_PASSPORT (unset/empty → anonymous).
pub fn claims(&self) -> &Claims
Sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
Best display name: descriptor (freshest) → token claim → the sub itself.
Sourcepub fn descriptor(&self) -> Option<&Descriptor>
pub fn descriptor(&self) -> Option<&Descriptor>
The fetched descriptor, once Passport::poll has collected it.
Sourcepub fn avatar_spec(&self) -> Option<&AvatarSpec>
pub fn avatar_spec(&self) -> Option<&AvatarSpec>
The traveler’s own AvatarSpec (the shared avatar model), once the
descriptor has landed and if the issuer provided one.
Sourcepub fn descriptor_error(&self) -> Option<&str>
pub fn descriptor_error(&self) -> Option<&str>
Why the last descriptor fetch failed, if it did (e.g. 410 Gone after
erasure — spec §6 — in which case the traveler renders anonymous).
Sourcepub fn fetch_descriptor(&mut self)
pub fn fetch_descriptor(&mut self)
Start fetching the descriptor from the token’s avatar claim on a
background thread. No-op without a claim URL, while a fetch is in
flight, or once loaded (the descriptor is session-cached; spec §3).