Struct identity_iota::client::ExplorerUrl
source · [−]#[repr(transparent)]pub struct ExplorerUrl(_);
Expand description
A Tangle explorer URL with convenience functions for constructing URLs for viewing published messages or IOTA DIDs.
Example
let explorer = ExplorerUrl::mainnet();
let did = IotaDID::parse("did:iota:H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV")?;
assert_eq!(
explorer.resolver_url(&did)?,
"https://explorer.iota.org/mainnet/identity-resolver/did:iota:H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
);
Implementations
sourceimpl ExplorerUrl
impl ExplorerUrl
sourcepub fn new(url: Url) -> Result<ExplorerUrl, Error>
pub fn new(url: Url) -> Result<ExplorerUrl, Error>
Constructs a new Tangle explorer URL.
Use ExplorerUrl::mainnet
or ExplorerUrl::devnet
unless using a private Tangle
or local explorer.
NOTE: does not validate whether this corresponds to an actual Tangle explorer.
sourcepub fn parse(url: &str) -> Result<ExplorerUrl, Error>
pub fn parse(url: &str) -> Result<ExplorerUrl, Error>
Constructs a new Tangle explorer URL from a string.
See ExplorerUrl::new
.
Example
Point to a Tangle explorer deployed locally.
let explorer = ExplorerUrl::parse("http://127.0.0.1:8082/")?;
sourcepub fn mainnet() -> &'static ExplorerUrl
pub fn mainnet() -> &'static ExplorerUrl
Returns the Tangle explorer URL for the mainnet.
sourcepub fn devnet() -> &'static ExplorerUrl
pub fn devnet() -> &'static ExplorerUrl
Returns the Tangle explorer URL for the devnet.
Trait Implementations
sourceimpl AsRef<str> for ExplorerUrl
impl AsRef<str> for ExplorerUrl
sourceimpl Clone for ExplorerUrl
impl Clone for ExplorerUrl
sourcefn clone(&self) -> ExplorerUrl
fn clone(&self) -> ExplorerUrl
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ExplorerUrl
impl Debug for ExplorerUrl
sourceimpl<'de> Deserialize<'de> for ExplorerUrl
impl<'de> Deserialize<'de> for ExplorerUrl
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<ExplorerUrl, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ExplorerUrl, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for ExplorerUrl
impl Display for ExplorerUrl
sourceimpl FromStr for ExplorerUrl
impl FromStr for ExplorerUrl
sourceimpl PartialEq<ExplorerUrl> for ExplorerUrl
impl PartialEq<ExplorerUrl> for ExplorerUrl
sourcefn eq(&self, other: &ExplorerUrl) -> bool
fn eq(&self, other: &ExplorerUrl) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ExplorerUrl) -> bool
fn ne(&self, other: &ExplorerUrl) -> bool
This method tests for !=
.
sourceimpl Serialize for ExplorerUrl
impl Serialize for ExplorerUrl
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
sourceimpl<'_> TryFrom<&str> for ExplorerUrl
impl<'_> TryFrom<&str> for ExplorerUrl
sourceimpl TryFrom<Url> for ExplorerUrl
impl TryFrom<Url> for ExplorerUrl
impl Eq for ExplorerUrl
impl StructuralEq for ExplorerUrl
impl StructuralPartialEq for ExplorerUrl
Auto Trait Implementations
impl RefUnwindSafe for ExplorerUrl
impl Send for ExplorerUrl
impl Sync for ExplorerUrl
impl Unpin for ExplorerUrl
impl UnwindSafe for ExplorerUrl
Blanket Implementations
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>
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