[][src]Struct did_url::DID

pub struct DID { /* fields omitted */ }

A Decentralized Identifier (DID).

More Info (W3C DID Core)

Implementations

impl DID[src]

pub const SCHEME: &'static str[src]

The URL scheme for Decentralized Identifiers.

pub fn parse(input: impl AsRef<str>) -> Result<Self>[src]

Parses a DID from the provided input.

Errors

Returns Err if any DID segments are invalid.

pub const fn inspect(&self) -> Inspect<'_>[src]

Returns a wrapped DID with a more detailed Debug implementation.

pub fn as_str(&self) -> &str[src]

Returns the serialized DID.

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

pub fn into_string(self) -> String[src]

Consumes the DID and returns the serialization.

pub const fn scheme(&self) -> &'static str[src]

Returns the DID scheme. See DID::SCHEME.

pub fn authority(&self) -> &str[src]

Returns the DID authority.

pub fn method(&self) -> &str[src]

Returns the DID method name.

pub fn method_id(&self) -> &str[src]

Returns the DID method-specific ID.

pub fn path(&self) -> &str[src]

Returns the DID path.

pub fn query(&self) -> Option<&str>[src]

Returns the DID method query, if any.

pub fn fragment(&self) -> Option<&str>[src]

Returns the DID method fragment, if any.

pub fn query_pairs(&self) -> Parse<'_>[src]

Parses the DID query and returns an iterator of (key, value) pairs.

pub fn set_method(&mut self, value: impl AsRef<str>)[src]

Change the method of the DID.

pub fn set_method_id(&mut self, value: impl AsRef<str>)[src]

Change the method-specific-id of the DID.

pub fn set_path(&mut self, value: impl AsRef<str>)[src]

Change the path of the DID.

pub fn set_query(&mut self, value: Option<&str>)[src]

Change the query of the DID.

No serialization is performed.

pub fn set_fragment(&mut self, value: Option<&str>)[src]

Change the fragment of the DID.

No serialization is performed.

pub fn join(&self, other: impl AsRef<str>) -> Result<Self>[src]

Creates a new DID by joining self with the relative DID other.

Errors

Returns Err if any base or relative DID segments are invalid.

Trait Implementations

impl AsRef<str> for DID[src]

impl Clone for DID[src]

impl Debug for DID[src]

impl Display for DID[src]

impl Eq for DID[src]

impl From<DID> for String[src]

impl FromStr for DID[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for DID[src]

impl Ord for DID[src]

impl<'_> PartialEq<&'_ str> for DID[src]

impl PartialEq<DID> for DID[src]

impl PartialEq<str> for DID[src]

impl PartialOrd<DID> for DID[src]

impl TryFrom<String> for DID[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for DID

impl Send for DID

impl Sync for DID

impl Unpin for DID

impl UnwindSafe for DID

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.