In #42 we discussed the AsRef trait implementations for the existing DnsNameRef and DnsName types, as well as the new WildcardDnsNameRef type.
We reached the conclusion that WildcardDnsNameRef should implement AsRef<str>, since it best captures the guarantee that the contents of WildcardDnsNameRef are valid UTF-8, and its trivial to go from &str to &[u8]. See this discussion thread for more information.
The same reasoning can be applied to DnsName/DnsNameRef. Both should offer AsRef<str> and we should remove the AsRef<[u8]> impl from DnsNameRef. This will be a breaking change, so we need to hold this for the next API incompatible change set.
In #42 we discussed the
AsReftrait implementations for the existingDnsNameRefandDnsNametypes, as well as the newWildcardDnsNameReftype.We reached the conclusion that
WildcardDnsNameRefshould implementAsRef<str>, since it best captures the guarantee that the contents ofWildcardDnsNameRefare valid UTF-8, and its trivial to go from&strto&[u8]. See this discussion thread for more information.The same reasoning can be applied to
DnsName/DnsNameRef. Both should offerAsRef<str>and we should remove theAsRef<[u8]>impl fromDnsNameRef. This will be a breaking change, so we need to hold this for the next API incompatible change set.