Skip to main content

DidUrl

Struct DidUrl 

Source
pub struct DidUrl {
    pub did: String,
    pub fragment: Option<String>,
}
Expand description

A parsed proof.verificationMethod DID URL.

Fields§

§did: String

The DID without any fragment, e.g. did:web:notary.example.com.

§fragment: Option<String>

The fragment after #, when present — the key identifier.

Implementations§

Source§

impl DidUrl

Source

pub fn parse(input: &str) -> Self

Splits a DID URL into its DID and fragment.

Source

pub fn web_identifier(&self) -> Option<&str>

Returns the did:web method-specific identifier, if this is a did:web DID.

Source

pub fn web_document_url(&self) -> Option<String>

Builds the HTTPS URL of the DID Document for a did:web DID (spec §8.4.4 step 2).

Per the did:web method, colons in the identifier map to path segments, and an identifier with no path resolves under /.well-known/. Each segment is percent-decoded AFTER the split, which is how a port written %3A8443 stays attached to the host instead of becoming a path segment.

Source

pub fn web_status_url(&self) -> Option<String>

Builds the HTTPS URL of the DERIVED revocation status endpoint for a did:web DID (spec §6.3.3.2 step 2).

§6.3.3.2 defines this by reference — “apply §8.4.4 step 2’s rule … then suffix /.well-known/aph-status.json in place of /.well-known/did.json” — so it shares Self::web_document_url’s derivation exactly and differs only in the last path segment. Sharing the body is the point: the two endpoints must agree about the host, or the same-origin binding of §6.3.3.2 compares an origin against one the same DID would never have produced.

This is the origin a verifier trusts. The statusListCredential value an envelope carries is NEVER used to derive it — it is only ever bound against it by same_origin.

Source

pub fn dns_txt_name(&self) -> Option<String>

Returns the registrable-domain portion used to build the DNS TXT name (spec §8.4.5 step 1), i.e. the host without any path segments.

Trait Implementations§

Source§

impl Clone for DidUrl

Source§

fn clone(&self) -> Self

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 Debug for DidUrl

Source§

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

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

impl Eq for DidUrl

Source§

impl PartialEq for DidUrl

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DidUrl

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.