pub struct DidUrl { /* private fields */ }Expand description
A parsed DID URL — the canonical, inert addressing type (#906 G1).
Carries zero authority: a DidUrl is a selector. Everything authoritative
(identity, assurance, content) is created at the GATE (capsule content) and
the admission boundary (subject assurance) during dereferencing — never in
the URL itself (#905 §8). The same string reproduced by an attacker grants
them nothing; separately accepted state, typed reach, and live possession
are still required before any runtime operation can grant authority.
Implementations§
Source§impl DidUrl
impl DidUrl
Sourcepub fn parse(url: &str) -> Result<Self>
pub fn parse(url: &str) -> Result<Self>
Parse a DID URL string per the ratified #906 grammar.
Rejects non-did: schemes (9p://, moq://, https://, …). See the
module docs for the full param-grammar contract; in particular
versionId / versionTime fail closed and hl / unknown params are
ignored.
Sourcepub fn path(&self) -> &[String]
pub fn path(&self) -> &[String]
Percent-decoded URL path segments (9P walk selectors), verbatim.
Sourcepub fn service(&self) -> Option<&str>
pub fn service(&self) -> Option<&str>
?service=<id> if present (without #). None means “default”.
Sourcepub fn relative_ref(&self) -> Option<&[String]>
pub fn relative_ref(&self) -> Option<&[String]>
?relativeRef=<path> if present. Path is canonical; see
Self::walk_segments for the normalized walk.
Sourcepub fn pin(&self) -> Option<&str>
pub fn pin(&self) -> Option<&str>
?pin=<cid> — a validated CIDv1 string applied (client-verified) at READ.
Sourcepub fn aname(&self) -> &str
pub fn aname(&self) -> &str
The selected service fragment id (without #), defaulting to
DEFAULT_SERVICE ("ns"). This is the aname for Tattach.
Sourcepub fn walk_segments(&self) -> Vec<&str>
pub fn walk_segments(&self) -> Vec<&str>
The effective 9P walk segments. Path is canonical: when the URL path
is non-empty it wins and relativeRef is ignored (normalized away). When
only relativeRef is present, it supplies the walk. Empty when neither
carries a walk (attach the export root).
This is the single source of truth for “what to Twalk” — callers must
not consult Self::path and Self::relative_ref independently.
Sourcepub fn plan(&self) -> DereferencePlan
pub fn plan(&self) -> DereferencePlan
Build the dereference plan (aname + walk + pin) from the parsed URL.
Pure (no resolution). Before using these selectors, a runtime must verify the genesis GATE, obtain accepted current state, select/decode typed reach, and establish live possession. This module implements none of those authority-bearing stages and does not invent #1027 admission.
Trait Implementations§
impl Eq for DidUrl
impl StructuralPartialEq for DidUrl
Auto Trait Implementations§
impl Freeze for DidUrl
impl RefUnwindSafe for DidUrl
impl Send for DidUrl
impl Sync for DidUrl
impl Unpin for DidUrl
impl UnsafeUnpin for DidUrl
impl UnwindSafe for DidUrl
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more