Document defaults for all the config lists

And add an imprecation in define_list_config_builder's doc comment do
do so in future for other invocations of the macro.

Add add the missing full stops.
This commit is contained in:
Ian Jackson 2022-04-25 17:38:40 +01:00
parent bb81a412ea
commit ce877e4421
5 changed files with 15 additions and 4 deletions

View File

@ -66,7 +66,9 @@ impl LoggingConfig {
type LogfileListConfig = Vec<LogfileConfig>;
define_list_config_builder! {
/// List of logfiles to use, being built as part of the configuration
/// List of logfiles to use, being built as part of the configuration.
///
/// The default is not to log to any files.
pub struct LogfileListConfigBuilder {
files: [LogfileConfigBuilder],
}

View File

@ -186,7 +186,9 @@ fn default_preemptive_threshold() -> usize {
type PredictedPortsList = Vec<u16>;
define_list_config_builder! {
/// List of preemptive ports, being built as part of the configuration
/// List of preemptive ports, being built as part of the configuration.
///
/// The default is `[80, 443]`.
pub struct PredictedPortsListBuilder {
pub(crate) ports: [u16],
}

View File

@ -7,6 +7,7 @@
///
/// `#[derive(Default, Clone, Deserialize)]` will be applied, but you can specify other attributes
/// too. You should supply a doc comment for the builder struct, as shown in the example.
/// The doc comment should state the default value.
///
/// The `built` clause specifies the type of the built value, and how to construct it.
/// In the expression part, `things` (the field name) will be the resolved `Vec<Thing>`

View File

@ -45,7 +45,10 @@ impl Authority {
pub(crate) type AuthorityList = Vec<Authority>;
define_list_config_builder! {
/// List of authorities, being built as part of the configuration
/// List of authorities, being built as part of the configuration.
///
/// The default is to use a set of compiled-in authorities,
/// whose identities and public keys are shipped as part of the Arti source code.
pub struct AuthorityListBuilder {
authorities: [AuthorityBuilder],
}

View File

@ -31,11 +31,14 @@ impl<T: IntoIterator<Item = FallbackDir>> From<T> for FallbackList {
}
define_list_config_builder! {
/// List of fallback directories, being built as part of the configuration
/// List of fallback directories, being built as part of the configuration.
///
/// Fallback directories (represented by [`FallbackDir`]) are used by Tor
/// clients when they don't already have enough other directory information to
/// contact the network.
///
/// The default is to use a set of compiled-in fallback directories,
/// whose addresses and public keys are shipped as part of the Arti source code.
pub struct FallbackListBuilder {
pub(crate) fallbacks: [FallbackDirBuilder],
}