mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #1652] Unable to customise ip_strategy #726
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#726
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 @PurpleBooth on GitHub (Feb 28, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1652
Describe the bug
Currently there's no way to create a
ResolverOptsto customize the IP Lookup Strategy due to it being flagged as non exhaustive.To Reproduce
Steps to reproduce the behavior:
Try and create a struct to customise the IP Strategy, outside the crate.
Expected behavior
A clear and concise description of what you expected to happen.
To have a way to customize the Ip Strategy
Actual behavior
The library to compile
System:
Version:
Crate: trust-dns-resolver
Version: v0.21.1
Additional context
This is currently fine with 0.20.4. This is an intended effect of non_exhaustive. I am not tied to constructing this way, I just need a way to cusomize the strategy.
@djc commented on GitHub (Feb 28, 2022):
The way you do it is this:
@PurpleBooth commented on GitHub (Feb 28, 2022):
Oh geez, worked. I am an idiot, thanks!
@djc commented on GitHub (Feb 28, 2022):
No worries, I was only able to supply you with a quick response after taking about an hour to figure it out myself this morning! 😅
@bluejekyll commented on GitHub (Feb 28, 2022):
Maybe we should make all the fields hidden, and only use setter methods to remove this confusion. This isn’t the first time.
@djc commented on GitHub (Mar 1, 2022):
Yeah, I think the builder pattern would be more idiomatic.
@PurpleBooth commented on GitHub (Mar 1, 2022):
I also spent a bit of time actually looking through the source expecting a builder pattern to be present