Documentation fixes.

This commit is contained in:
Martin Hoffmann
2023-02-06 17:38:38 +01:00
parent 2a613d1773
commit 32cb3d4664
7 changed files with 15 additions and 82 deletions
+2 -3
View File
@@ -11,9 +11,8 @@
//! as they are for comparisons. In order to make it clear when this mode
//! of comparision is used, this module defines a new trait [`CanonicalOrd`]
//! that allows types to define how they should be compared in the context of
//! DNSSEC. The trait is accompanied by
//! [`Compose::compose_canonical`][super::octets::Compose::compose_canonical]
//! which produces the canonical form of this data.
//! DNSSEC. The trait is accompanied by `compose_canonical` methods on all
//! types that have or may have a canonical form.
use core::cmp::Ordering;
+4 -3
View File
@@ -501,9 +501,10 @@ impl<Target: Composer> QuestionBuilder<Target> {
/// Appends a question to the question section.
///
/// This method accepts anything that implements the [`ComposeQuestion`]
/// trait. Apart from an actual [`Question`] or a reference to it, this
/// can also be a tuple of a domain name, record type, and class or, if
/// the class is the usual IN, a pair of just the name and type.
/// trait. Apart from an actual [`Question`][super::question::Question]
/// or a reference to it, this can also be a tuple of a domain name,
/// record type, and class or, if the class is the usual IN, a pair of
/// just the name and type.
///
/// In other words, the options are:
///
+4 -1
View File
@@ -68,7 +68,10 @@
//! # Zone File Processing
//!
//! Handling for the text format for DNS data from zone files is available
//! via the [zonefile] module. See there for more information.
//! via the crate’s
#![cfg_attr(feature = "zonefile", doc = "[zonefile][crate::zonefile]")]
#![cfg_attr(not(feature = "zonefile"), doc = "zonefile")]
//! module. See there for more information.
//!
//!
//! # Support for `no_std`
-2
View File
@@ -268,8 +268,6 @@ impl<Octs: ?Sized> Dname<Octs> {
/// # Properties
///
/// More of the usual methods on octets sequences, such as `len`, are
/// available via the implementation of `Deref<Target = Octs>`.
impl<Octs: AsRef<[u8]> + ?Sized> Dname<Octs> {
/// Returns whether the name is the root label only.
pub fn is_root(&self) -> bool {
+4 -2
View File
@@ -70,8 +70,10 @@ use octseq::parse::Parser;
/// the generics through type inference. Secondly, you can parse a record
/// from an existing message. [`Message`] and its friends provide a way to
/// do that; see there for all the details. Finally, you can scan a record
/// from zone file format. See the [`domain::zonefile`] module for
/// that.
/// from zone file format. See the crate’s
#[cfg_attr(feature = "zonefile", doc = "[zonefile][crate::zonefile]")]
#[cfg_attr(not(feature = "zonefile"), doc = "zonefile")]
/// module for that.
///
/// [`new`]: #method.new
/// [`Message`]: ../message/struct.Message.html
+1 -1
View File
@@ -15,7 +15,7 @@
//! This module provides a simple scanner that uses a sequence of strings as
//! its source and can be used to, for instance, read record data from
//! command line arguments. A “proper” scanner is included in the
#![cfg_attr(feature = "zonefile", doc = "[zonefile]")]
#![cfg_attr(feature = "zonefile", doc = "[zonefile][crate::zonefile]")]
#![cfg_attr(not(feature = "zonefile"), doc = "zonefile")]
//! module.
#![allow(clippy::manual_range_contains)] // Hard disagree.
-70
View File
@@ -472,61 +472,6 @@ macro_rules! rdata_types {
}
}
/*
//--- Serialize and Deserialize
#[cfg(feature = "serde")]
impl<O, N> serde::Serialize for ZoneRecordData<O, N>
where
O: AsRef<[u8]> + crate::base::octets::SerializeOctets,
N: serde::Serialize,
{
fn serialize<S: serde::Serializer>(
&self, serializer: S
) -> Result<S::Ok, S::Error> {
use crate::base::iana::Rtype;
match *self {
$( $( $(
ZoneRecordData::$mtype(ref inner) => {
serializer.serialize_newtype_variant(
"ZoneRecordData",
Rtype::$mtype.to_int().into(),
stringify!($mtype),
inner
)
}
)* )* )*
ZoneRecordData::Unknown(ref inner) => {
serializer.serialize_newtype_variant(
"ZoneRecordData",
u32::MAX,
"Unknown",
inner
)
}
}
}
}
#[cfg(feature = "serde")]
impl<'de, O, N> serde::Deserialize<'de> for ZoneRecordData<O, N>
where
O: crate::base::octets::FromBuilder
+ crate::base::octets::DeserializeOctets<'de>,
<O as crate::base::octets::FromBuilder>::Builder:
crate::base::octets::OctetsBuilder<Octets = O>
+ crate::base::octets::EmptyBuilder,
N: serde::Deserialize<'de>,
{
fn deserialize<D: serde::Deserializer<'de>>(
_deserializer: D
) -> Result<Self, D::Error> {
unimplemented!()
}
}
*/
//------------- AllRecordData ----------------------------------------
/// Record data for all record types.
@@ -562,21 +507,6 @@ macro_rules! rdata_types {
}
)* )* )*
/*
$( $( $(
AllRecordData::$mtype(_) => {
<$mtype $( < $( $mn ),* > )*
as $crate::base::rdata::RtypeRecordData>::RTYPE
}
)* )* )*
$( $( $(
AllRecordData::$ptype(_) => {
<$ptype $( < $( $pn ),* > )*
as $crate::base::rdata::RtypeRecordData>::RTYPE
}
)* )* )*
*/
AllRecordData::Opt(_) => $crate::base::iana::Rtype::Opt,
AllRecordData::Unknown(ref inner) => inner.rtype(),
}