rust-public-ip
rust-public-ip copied to clipboard
Filter resolvers to compatible address type instead of trying resolvers until a compatible address type comes out
Right now, when querying for a specific address family, this generates a stream of results that query any resolvers, and will potentially query an incompatible resolver, just to throw away the result because the result is incompatible. This potentially delays the result and causes unnecessary load on the backend providers side.
I'd be willing to implement this, but I'd like to wait for feedback here if this is wanted and whether you have any strong opinions on how this should be implemented.
Is this really the case? The family is passed to the resolver, see: https://github.com/avitex/rust-public-ip/blob/675505fd52d56805a3684004ad5d0a6523def2b7/src/lib.rs#L195-L201
It is not expected that a different family is returned, but checked still.