trust-dns | A Rust based DNS client , server , and resolver | DNS library
kandi X-RAY | trust-dns Summary
kandi X-RAY | trust-dns Summary
A Rust based DNS client, server, and resolver
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of trust-dns
trust-dns Key Features
trust-dns Examples and Code Snippets
Community Discussions
Trending Discussions on trust-dns
QUESTION
I am writing an XMPP client. The RFC says I need to connect to the server (like this one) using a SRV query.
When I use the trust_dns_resolver crate to do so, the query seems to be empty. Is this the normal behavior?
...ANSWER
Answered 2021-Jul-28 at 16:31It's ok if the SRV lookup return no IP address. in my case, the query return only few tuples composed of a domain name and a port number. After getting them, I have to resolve each one to get its IP address with its port number.
The
trust_dns_proto
crate is mandatory to deal with SRV lookup. So I add it to theCargo.toml
file, and the compiler stop crying...
Then I can write the following code to extract both port number and domain name:
QUESTION
What's an efficient way to convert a result of type &[Box<[u8]>]
into something more readily consumed like String
or &str
?
An example function is the txt_data()
method from trust_dns_proto::rr:rdat::txt::TXT
.
I've tried several things that seem to go nowhere, like:
...ANSWER
Answered 2020-May-18 at 03:15It looks like the solution is this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install trust-dns
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page