dns_name

Macro dns_name 

Source
macro_rules! dns_name {
    ($value:expr $(,)?) => { ... };
}
Expand description

Create a new DnsName from a byte slice. The domain name must be dot separated. The constructor will check convert the domain name to DNS wire format and check if it is valid. This macro accepts an expression as input, which is evaluated at compile time. If you want to create a DnsName from a byte slice of unknown length, use the DnsName::new function instead.

ยงExample

use flex_dns::dns_name;
use flex_dns::name::DnsName;

const NAME: DnsName = dns_name!(b"example.com");