Struct identity_iota::iota_core::NetworkName
source · [−]#[repr(transparent)]pub struct NetworkName(_);
Expand description
Network name compliant with the IOTA DID method specification.
Implementations
sourceimpl NetworkName
impl NetworkName
sourcepub fn try_from<T>(name: T) -> Result<NetworkName, Error> where
T: Into<Cow<'static, str>>,
pub fn try_from<T>(name: T) -> Result<NetworkName, Error> where
T: Into<Cow<'static, str>>,
Creates a new NetworkName
if the name passes validation.
sourcepub fn validate_network_name(name: &str) -> Result<(), Error>
pub fn validate_network_name(name: &str) -> Result<(), Error>
Validates whether a string is a spec-compliant IOTA DID NetworkName
.
Methods from Deref<Target = Cow<'static, str>>
sourcepub fn is_borrowed(&self) -> bool
🔬 This is a nightly-only experimental API. (cow_is_borrowed
)
pub fn is_borrowed(&self) -> bool
cow_is_borrowed
)Returns true if the data is borrowed, i.e. if to_mut
would require additional work.
Examples
#![feature(cow_is_borrowed)]
use std::borrow::Cow;
let cow = Cow::Borrowed("moo");
assert!(cow.is_borrowed());
let bull: Cow<'_, str> = Cow::Owned("...moo?".to_string());
assert!(!bull.is_borrowed());
sourcepub fn is_owned(&self) -> bool
🔬 This is a nightly-only experimental API. (cow_is_borrowed
)
pub fn is_owned(&self) -> bool
cow_is_borrowed
)Returns true if the data is owned, i.e. if to_mut
would be a no-op.
Examples
#![feature(cow_is_borrowed)]
use std::borrow::Cow;
let cow: Cow<'_, str> = Cow::Owned("moo".to_string());
assert!(cow.is_owned());
let bull = Cow::Borrowed("...moo?");
assert!(!bull.is_owned());
Trait Implementations
sourceimpl AsRef<str> for NetworkName
impl AsRef<str> for NetworkName
sourceimpl Clone for NetworkName
impl Clone for NetworkName
sourcefn clone(&self) -> NetworkName
fn clone(&self) -> NetworkName
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 NetworkName
impl Debug for NetworkName
sourceimpl Deref for NetworkName
impl Deref for NetworkName
sourceimpl<'de> Deserialize<'de> for NetworkName
impl<'de> Deserialize<'de> for NetworkName
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<NetworkName, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<NetworkName, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for NetworkName
impl Display for NetworkName
sourceimpl From<NetworkName> for Cow<'static, str>
impl From<NetworkName> for Cow<'static, str>
sourcefn from(network_name: NetworkName) -> Cow<'static, str>
fn from(network_name: NetworkName) -> Cow<'static, str>
Converts to this type from the input type.
sourceimpl Hash for NetworkName
impl Hash for NetworkName
sourceimpl Ord for NetworkName
impl Ord for NetworkName
sourceimpl PartialEq<NetworkName> for NetworkName
impl PartialEq<NetworkName> for NetworkName
sourcefn eq(&self, other: &NetworkName) -> bool
fn eq(&self, other: &NetworkName) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &NetworkName) -> bool
fn ne(&self, other: &NetworkName) -> bool
This method tests for !=
.
sourceimpl PartialOrd<NetworkName> for NetworkName
impl PartialOrd<NetworkName> for NetworkName
sourcefn partial_cmp(&self, other: &NetworkName) -> Option<Ordering>
fn partial_cmp(&self, other: &NetworkName) -> 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 Serialize for NetworkName
impl Serialize for NetworkName
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<&'static str> for NetworkName
impl TryFrom<&'static str> for NetworkName
sourceimpl TryFrom<String> for NetworkName
impl TryFrom<String> for NetworkName
impl Eq for NetworkName
impl StructuralEq for NetworkName
impl StructuralPartialEq for NetworkName
Auto Trait Implementations
impl RefUnwindSafe for NetworkName
impl Send for NetworkName
impl Sync for NetworkName
impl Unpin for NetworkName
impl UnwindSafe for NetworkName
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