cleanup rust docs

This commit is contained in:
Benjamin Fry 2024-01-01 12:04:41 -08:00
parent 356bb541a4
commit 642d33ca71
8 changed files with 19 additions and 17 deletions

View File

@ -27,7 +27,7 @@
//!
//! Unlike the `hickory-client`, this tries to provide a simpler interface to perform DNS queries. For update options, i.e. Dynamic DNS, the `hickory-client` crate must be used instead. The Resolver library is capable of searching multiple domains (this can be disabled by using an FQDN during lookup), dual-stack IPv4/IPv6 lookups, performing chained CNAME lookups, and features connection metric tracking for attempting to pick the best upstream DNS resolver.
//!
//! Use [`AsyncResolver`](crate::AsyncResolver) for performing DNS queries. `AsyncResolver` is a `async-std` based async resolver, and can be used inside any `asyn-std` based system.
//! Use [`AsyncResolver`] for performing DNS queries. `AsyncResolver` is a `async-std` based async resolver, and can be used inside any `asyn-std` based system.
//!
//! This as best as possible attempts to abide by the DNS RFCs, please file issues at <https://github.com/hickory-dns/hickory-dns>.
//!

View File

@ -680,7 +680,7 @@ impl Clone for ProtoErrorKind {
}
}
/// A trait marking a type which implements From<ProtoError> and
/// A trait marking a type which implements `From<ProtoError>` and
/// std::error::Error types as well as Clone + Send
pub trait FromProtoError: From<ProtoError> + std::error::Error + Clone {}

View File

@ -27,10 +27,10 @@ use crate::xfer::SerialMessage;
use crate::BufDnsStreamHandle;
pub(crate) const MDNS_PORT: u16 = 5353;
/// mDNS ipv4 address https://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml
/// mDNS ipv4 address, see [multicast-addresses](https://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml)
pub static MDNS_IPV4: Lazy<SocketAddr> =
Lazy::new(|| SocketAddr::new(Ipv4Addr::new(224, 0, 0, 251).into(), MDNS_PORT));
/// link-local mDNS ipv6 address https://www.iana.org/assignments/ipv6-multicast-addresses/ipv6-multicast-addresses.xhtml
/// link-local mDNS ipv6 address, see [ipv6-multicast-addresses](https://www.iana.org/assignments/ipv6-multicast-addresses/ipv6-multicast-addresses.xhtml)
pub static MDNS_IPV6: Lazy<SocketAddr> = Lazy::new(|| {
SocketAddr::new(
Ipv6Addr::new(0xFF02, 0, 0, 0, 0, 0, 0, 0x00FB).into(),

View File

@ -224,14 +224,14 @@ impl CAA {
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
pub enum Property {
/// The issue property
/// entry authorizes the holder of the domain name <Issuer Domain
/// Name> or a party acting under the explicit authority of the holder
/// entry authorizes the holder of the domain name `Issuer Domain
/// Name`` or a party acting under the explicit authority of the holder
/// of that domain name to issue certificates for the domain in which
/// the property is published.
Issue,
/// The issuewild
/// property entry authorizes the holder of the domain name <Issuer
/// Domain Name> or a party acting under the explicit authority of the
/// property entry authorizes the holder of the domain name `Issuer
/// Domain Name` or a party acting under the explicit authority of the
/// holder of that domain name to issue wildcard certificates for the
/// domain in which the property is published.
IssueWild,
@ -470,7 +470,7 @@ enum ParseNameKeyPairState {
///
/// Updated parsing rules:
///
/// [RFC8659] Canonical presentation form and ABNF](https://www.rfc-editor.org/rfc/rfc8659#name-canonical-presentation-form)
/// [RFC8659 Canonical presentation form and ABNF](https://www.rfc-editor.org/rfc/rfc8659#name-canonical-presentation-form)
///
/// This explicitly allows `-` in key names, diverging from the original RFC. To support this, key names will
/// allow `-` as non-starting characters. Additionally, this significantly relaxes the characters allowed in the value

View File

@ -56,8 +56,8 @@ impl HINFO {
///
/// # Arguments
///
/// * `cpu` - A <character-string> which specifies the CPU type.
/// * `os` - A <character-string> which specifies the operating system type.
/// * `cpu` - A `character-string` which specifies the CPU type.
/// * `os` - A `character-string` which specifies the operating system type.
///
/// # Return value
///
@ -74,8 +74,8 @@ impl HINFO {
///
/// # Arguments
///
/// * `cpu` - A <character-string> which specifies the CPU type.
/// * `os` - A <character-string> which specifies the operating system type.
/// * `cpu` - A `character-string` which specifies the CPU type.
/// * `os` - A `character-string` which specifies the operating system type.
///
/// # Return value
///
@ -84,12 +84,12 @@ impl HINFO {
Self { cpu, os }
}
/// A <character-string> which specifies the CPU type.
/// A `character-string` which specifies the CPU type.
pub fn cpu(&self) -> &[u8] {
&self.cpu
}
/// A <character-string> which specifies the operating system type.
/// A `character-string` which specifies the operating system type.
pub fn os(&self) -> &[u8] {
&self.os
}

View File

@ -557,6 +557,7 @@ impl<'a> From<&'a EdnsOption> for EdnsCode {
/// [RFC 7871, Client Subnet, Optional](https://tools.ietf.org/html/rfc7871)
///
/// ```text
/// +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
/// 0: | FAMILY |
/// +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
@ -583,6 +584,7 @@ impl<'a> From<&'a EdnsOption> for EdnsCode {
/// SOURCE PREFIX-LENGTH, SHOULD return FORMERR to reject the packet,
/// as a signal to the software developer making the request to fix
/// their implementation.
/// ```
#[cfg_attr(feature = "serde-config", derive(Deserialize, Serialize))]
#[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy, Hash)]
pub struct ClientSubnet {

View File

@ -220,7 +220,7 @@ impl OneshotDnsResponse {
}
}
/// A Stream that wraps a oneshot::Receiver<Stream> and resolves to items in the inner Stream
/// A Stream that wraps a [`oneshot::Receiver<Stream>`] and resolves to items in the inner Stream
pub enum DnsResponseReceiver {
/// The receiver
Receiver(oneshot::Receiver<DnsResponseStream>),

View File

@ -158,7 +158,7 @@ impl Clone for ErrorKind {
}
}
/// A trait marking a type which implements From<Error> and
/// A trait marking a type which implements `From<Error>` and
/// std::error::Error types as well as Clone + Send
pub trait FromError: From<Error> + std::error::Error + Clone {}