Struct diem_sdk::types::network_address::DnsName [−][src]
pub struct DnsName(_);
Expand description
A minimally parsed DNS name. We don’t really do any checking other than enforcing:
- it is not an empty string
- it is not larger than 255 bytes
- it does not contain any forward slash ‘/’ characters
From the DNS name syntax RFC, the standard rules are:
- the total size <= 255 bytes
- each label <= 63 bytes
- any binary string is valid
So the restrictions we’re adding are (1) no ‘/’ characters and (2) the name
is a valid unicode string. We do this because ‘/’ characters are already our
protocol delimiter and Rust’s std::net::ToSocketAddrs
API requires a
&str
.
Trait Implementations
pub fn deserialize<D>(
deserializer: D
) -> Result<DnsName, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<DnsName, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub 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
Auto Trait Implementations
impl RefUnwindSafe for DnsName
impl UnwindSafe for DnsName
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Generates a hash used only for tests.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more