Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors the network stack traits around DNS to change the implementation details.
The driving reason behind this is to align it more closely with std-based targets. Specifically, DNS implementation details are not exposed to the user, and if DNS services are not available, DNS resolution will
Err
.This discussion came about as a result of quartiq/minimq#160, where we discussed the fact that there's two bounds required in our MQTT implementation.
I'm curious to hear feedback on this from other users of the DNS traits, CC @chrysn and @MathiasKoch
The intent here is to make DNS more of a "first class citizen" that is available for usage by all users. That way, client libraries that can take either an IP or a hostname can attempt resolution of the name and use the reuslt without requiring additional
Dns
trait bounds.This is essentially solidifying some implementation details. For example, the
smoltcp-nal
already implements theDns
trait, but it only provides non-Err
results if the user has set up the Smoltcp sockets with a DNS socket for processing. Thus, the trait bound isn't actually providing any value in protecting users from a missing DNS implementation.