pub trait DID: Clone + PartialEq<Self> + Eq + PartialOrd<Self> + Ord + Hash + FromStr + TryFrom<DID> {
    const SCHEME: &'static str = ;

    fn scheme(&self) -> &'static str;
    fn authority(&self) -> &str;
    fn method(&self) -> &str;
    fn method_id(&self) -> &str;
    fn as_str(&self) -> &str;
    fn into_string(self) -> String;
    fn join(self, value: impl AsRef<str>) -> Result<DIDUrl<Self>, DIDError>;
    fn to_url(&self) -> DIDUrl<Self>;
    fn into_url(self) -> DIDUrl<Self>;
}

Provided Associated Constants

Required Methods

Returns the DID scheme. See DID::SCHEME.

E.g.

  • "did:example:12345678" -> "did"
  • "did:iota:main:12345678" -> "did"

Returns the DID authority: the method name and method-id.

E.g.

  • "did:example:12345678" -> "example:12345678"
  • "did:iota:main:12345678" -> "iota:main:12345678"

Returns the DID method name.

E.g.

  • "did:example:12345678" -> "example"
  • "did:iota:main:12345678" -> "iota"

Returns the DID method-specific ID.

E.g.

  • "did:example:12345678" -> "12345678"
  • "did:iota:main:12345678" -> "main:12345678"

Returns the serialized DID.

This is fast since the serialized value is stored in the DID.

Consumes the DID and returns its serialization.

Constructs a DIDUrl by attempting to append a string representing a path, query, and/or fragment to this DID.

See DIDUrl::join.

Clones the DID into a DIDUrl of the same method.

Converts the DID into a DIDUrl of the same method.

Implementors