mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #1079] AsyncResolver type inference problem #600
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#600
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kornelski on GitHub (Apr 24, 2020).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1079
Code like this:
fails to compile:
This is problematic, because:
Rdoesn't mean anything. Rustc dug out some internal name that isn't related to anything I wrote. It's impossible to know what this refers to without looking it up.The documentation mentions
GenericConnectionProvider<R>, butGenericConnectionProvideris a private trait, so it is completely undocumented. I can't look up whatRis supposed to be. I can't search for what types implement it. I can't name it the code.I had to read this crate's source code to discover that
TokioConnectionProvidertype alias exists and it happens to satisfy the mysteriousRparameter. I'm surprised that thenewfunction that takes a tokio handle is still generic over the runtime.Could you add
TokioConnectionProvideras the default type for this implementation, or make a less genericnew_tokiofunction that automatically specifies this type?@bluejekyll commented on GitHub (Apr 24, 2020):
Ah, yes, we should clean this up. Probably deprecate the
new? Some of these changes have come in as we've genericized the AsyncResolver across runtimes beyond Tokio into Fuchsia and AsyncStd. I've tried to document this as best as possible, but that can always be better. We should probably recommend to use the AsyncStdResolver, https://docs.rs/async-std-resolver/0.19.4/async_std_resolver/, or the TokioResolver, https://docs.rs/trust-dns-resolver/0.19.4/trust_dns_resolver/type.TokioAsyncResolver.html.I'm happy to have suggestions for how we improve the experience here.