[][src]Struct identity_core::did::DID

pub struct DID {
    pub method_name: String,
    pub id_segments: Vec<String>,
    pub params: Option<Vec<Param>>,
    pub path_segments: Option<Vec<String>>,
    pub query: Option<String>,
    pub fragment: Option<String>,
}

Decentralized identity structure.

Fields

method_name: Stringid_segments: Vec<String>params: Option<Vec<Param>>path_segments: Option<Vec<String>>query: Option<String>fragment: Option<String>

Implementations

impl DID[src]

pub fn new(
    name: String,
    id_segments: Vec<String>,
    params: Option<Vec<(String, Option<String>)>>,
    path_segments: Option<Vec<String>>,
    query: Option<String>,
    fragment: Option<String>
) -> Result<Self>
[src]

Creates a new DID. params and fragment are both optional.

pub fn parse_from_str<T>(input: T) -> Result<Self> where
    T: ToString
[src]

pub fn add_params(&mut self, params: Vec<Param>)[src]

Method to add params to the DID.

pub fn add_path_segments(&mut self, path_segment: Vec<String>)[src]

add path segments to the current DID.

pub fn add_query(&mut self, query: String)[src]

add a query to the DID.

pub fn add_fragment(&mut self, fragment: String)[src]

Method to add a fragment to the DID.

Trait Implementations

impl Debug for DID[src]

impl Default for DID[src]

impl Display for DID[src]

Display trait for the DID struct.

impl Eq for DID[src]

impl PartialEq<DID> for DID[src]

impl StructuralEq for DID[src]

impl StructuralPartialEq for DID[src]

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> 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.