Struct identity_iota::did::DIDUrl
source · [−]Expand description
A DID Url: a DID with RelativeDIDUrl components.
E.g. “did:iota:H3C2AVvLMv6gmMNam3uVAjZar3cJCwDwnZn6z3wXmqPV/path?query1=a&query2=b#fragment”
Implementations
sourceimpl<D> DIDUrl<D> where
D: DID,
impl<D> DIDUrl<D> where
D: DID,
sourcepub fn new(did: D, url: Option<RelativeDIDUrl>) -> DIDUrl<D>
pub fn new(did: D, url: Option<RelativeDIDUrl>) -> DIDUrl<D>
Construct a new DIDUrl
with optional RelativeDIDUrl
.
sourcepub fn parse(input: impl AsRef<str>) -> Result<DIDUrl<D>, DIDError>
pub fn parse(input: impl AsRef<str>) -> Result<DIDUrl<D>, DIDError>
Parse a DIDUrl
from a string.
sourcepub fn url(&self) -> &RelativeDIDUrl
pub fn url(&self) -> &RelativeDIDUrl
Returns the RelativeDIDUrl
.
sourcepub fn set_url(&mut self, url: RelativeDIDUrl)
pub fn set_url(&mut self, url: RelativeDIDUrl)
Sets the RelativeDIDUrl
.
sourcepub fn set_fragment(&mut self, value: Option<&str>) -> Result<(), DIDError>
pub fn set_fragment(&mut self, value: Option<&str>) -> Result<(), DIDError>
Sets the fragment
component of the DIDUrl
.
sourcepub fn path(&self) -> Option<&str>
pub fn path(&self) -> Option<&str>
Returns the DIDUrl
path
component.
See RelativeDIDUrl::path
.
sourcepub fn set_path(&mut self, value: Option<&str>) -> Result<(), DIDError>
pub fn set_path(&mut self, value: Option<&str>) -> Result<(), DIDError>
Sets the path
component of the DIDUrl
.
sourcepub fn set_query(&mut self, value: Option<&str>) -> Result<(), DIDError>
pub fn set_query(&mut self, value: Option<&str>) -> Result<(), DIDError>
Sets the query
component of the DIDUrl
.
sourcepub fn query_pairs(&self) -> Parse<'_>
pub fn query_pairs(&self) -> Parse<'_>
Parses the DIDUrl
query and returns an iterator of (key, value) pairs.
sourcepub fn join(&self, segment: impl AsRef<str>) -> Result<DIDUrl<D>, DIDError>
pub fn join(&self, segment: impl AsRef<str>) -> Result<DIDUrl<D>, DIDError>
Append a string representing a path
, query
, and/or fragment
, returning a new DIDUrl
.
Must begin with a valid delimiter character: ‘/’, ‘?’, ‘#’. Overwrites the existing URL segment and any following segments in order of path, query, then fragment.
I.e.
- joining a path will overwrite the path and clear the query and fragment.
- joining a query will overwrite the query and clear the fragment.
- joining a fragment will only overwrite the fragment.
sourcepub fn from<U>(other: DIDUrl<U>) -> DIDUrl<D> where
U: DID + Into<D>,
pub fn from<U>(other: DIDUrl<U>) -> DIDUrl<D> where
U: DID + Into<D>,
Construct a DIDUrl<D>
from a DIDUrl<U>
of a different DID method.
Workaround for lack of specialisation preventing a generic From
implementation.
sourcepub fn try_from<U>(
other: DIDUrl<U>
) -> Result<DIDUrl<D>, <U as TryInto<D>>::Error> where
U: DID + TryInto<D>,
pub fn try_from<U>(
other: DIDUrl<U>
) -> Result<DIDUrl<D>, <U as TryInto<D>>::Error> where
U: DID + TryInto<D>,
Fallible version of DIDUrl::from
.
Trait Implementations
sourceimpl<D, T> AsRef<DIDUrl<D>> for VerificationMethod<D, T> where
D: DID,
impl<D, T> AsRef<DIDUrl<D>> for VerificationMethod<D, T> where
D: DID,
sourceimpl<'de, D> Deserialize<'de> for DIDUrl<D> where
D: DID + Deserialize<'de>,
DIDUrl<D>: Sized,
impl<'de, D> Deserialize<'de> for DIDUrl<D> where
D: DID + Deserialize<'de>,
DIDUrl<D>: Sized,
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<DIDUrl<D>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<DIDUrl<D>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<D> Diff for DIDUrl<D> where
D: DID,
impl<D> Diff for DIDUrl<D> where
D: DID,
type Type = DiffString
type Type = DiffString
diff chain features are slated for removal
The Corresponding Diff Type for the implemented Type.
sourcefn diff(&self, other: &DIDUrl<D>) -> Result<<DIDUrl<D> as Diff>::Type, Error>
fn diff(&self, other: &DIDUrl<D>) -> Result<<DIDUrl<D> as Diff>::Type, Error>
diff chain features are slated for removal
Finds the difference between two types; self
and other
and returns Self::Type
sourcefn merge(&self, diff: <DIDUrl<D> as Diff>::Type) -> Result<DIDUrl<D>, Error>
fn merge(&self, diff: <DIDUrl<D> as Diff>::Type) -> Result<DIDUrl<D>, Error>
diff chain features are slated for removal
Merges a Self::Type
with Self
sourceimpl<'query, T> From<&'query DIDUrl<T>> for DIDUrlQuery<'query> where
T: DID,
impl<'query, T> From<&'query DIDUrl<T>> for DIDUrlQuery<'query> where
T: DID,
sourcefn from(other: &'query DIDUrl<T>) -> DIDUrlQuery<'query>
fn from(other: &'query DIDUrl<T>) -> DIDUrlQuery<'query>
Converts to this type from the input type.
sourceimpl<'query, T> From<DIDUrl<T>> for DIDUrlQuery<'query> where
T: DID,
impl<'query, T> From<DIDUrl<T>> for DIDUrlQuery<'query> where
T: DID,
sourcefn from(other: DIDUrl<T>) -> DIDUrlQuery<'query>
fn from(other: DIDUrl<T>) -> DIDUrlQuery<'query>
Converts to this type from the input type.
sourceimpl<D> KeyComparable for DIDUrl<D> where
D: DID,
impl<D> KeyComparable for DIDUrl<D> where
D: DID,
sourceimpl<D> Ord for DIDUrl<D> where
D: DID,
impl<D> Ord for DIDUrl<D> where
D: DID,
sourceimpl<D> PartialOrd<DIDUrl<D>> for DIDUrl<D> where
D: DID,
impl<D> PartialOrd<DIDUrl<D>> for DIDUrl<D> where
D: DID,
sourcefn partial_cmp(&self, other: &DIDUrl<D>) -> Option<Ordering>
fn partial_cmp(&self, other: &DIDUrl<D>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<D> Serialize for DIDUrl<D> where
D: DID + Serialize,
DIDUrl<D>: Sized,
impl<D> Serialize for DIDUrl<D> where
D: DID + Serialize,
DIDUrl<D>: Sized,
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<D> Eq for DIDUrl<D> where
D: DID,
Auto Trait Implementations
impl<D> RefUnwindSafe for DIDUrl<D> where
D: RefUnwindSafe,
impl<D> Send for DIDUrl<D> where
D: Send,
impl<D> Sync for DIDUrl<D> where
D: Sync,
impl<D> Unpin for DIDUrl<D> where
D: Unpin,
impl<D> UnwindSafe for DIDUrl<D> where
D: UnwindSafe,
Blanket Implementations
impl<T> Base32Len for T where
T: AsRef<[u8]>,
impl<T> Base32Len for T where
T: AsRef<[u8]>,
fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> FromJson for T where
T: for<'de> Deserialize<'de>,
impl<T> FromJson for T where
T: for<'de> Deserialize<'de>,
sourcefn from_json(json: &impl AsRef<str>) -> Result<Self, Error>
fn from_json(json: &impl AsRef<str>) -> Result<Self, Error>
Deserialize Self
from a string of JSON text.
sourcefn from_json_slice(json: &impl AsRef<[u8]>) -> Result<Self, Error>
fn from_json_slice(json: &impl AsRef<[u8]>) -> Result<Self, Error>
Deserialize Self
from bytes of JSON text.
sourcefn from_json_value(json: Value) -> Result<Self, Error>
fn from_json_value(json: Value) -> Result<Self, Error>
Deserialize Self
from a [serde_json::Value
].
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> ToBase32 for T where
T: AsRef<[u8]>,
impl<T> ToBase32 for T where
T: AsRef<[u8]>,
fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
fn write_base32<W>(&self, writer: &mut W) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate. Read more
sourceimpl<T> ToHex for T where
T: AsRef<[u8]>,
impl<T> ToHex for T where
T: AsRef<[u8]>,
sourcefn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
Encode the hex strict representing self
into the result. Lower case
letters are used (e.g. f9b4ca
) Read more
sourcefn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
Encode the hex strict representing self
into the result. Upper case
letters are used (e.g. F9B4CA
) Read more
sourceimpl<T> ToJson for T where
T: Serialize,
impl<T> ToJson for T where
T: Serialize,
sourcefn to_json_value(&self) -> Result<Value, Error>
fn to_json_value(&self) -> Result<Value, Error>
Serialize self
as a [serde_json::Value
].
sourcefn to_json_pretty(&self) -> Result<String, Error>
fn to_json_pretty(&self) -> Result<String, Error>
Serialize self
as a pretty-printed string of JSON.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more