chiark / gitweb /
config derive: Improve docs
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 19 Mar 2025 19:32:20 +0000 (19:32 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 20 Mar 2025 00:23:06 +0000 (00:23 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/config_derive.rs

index a8203f32e1595295e567418f0168b5edeefb5073..1f39d45297bc2541878b58aeb296666ad7309363 100644 (file)
@@ -27,12 +27,38 @@ define_derive_deftly! {
   /// sections to look in.  But it is also used by general validation,
   /// unconditionally, to reject settings in the wrong section.
   ///
-  /// Atrributes:
+  /// # Atrributes `#[deftly(ATTR)]`
   ///
-  ///  * `limited`, `server`, `client`: cooked sets of settings;
-  ///    default `SKL` is `PerClient` except for `limited`
-  ///  * `global` and `per_client`: set the SKL.
-  ///  * `special(method, SKL)`
+  /// ## Overriding attributes (these take precedence)
+  ///
+  ///  * `skl = EXOR`: Set the SKL to `EXPR`.
+  ///  * `special`: use `ResolveContext::special_FIELDNAME`
+  ///
+  /// ## Other attributes
+  ///
+  ///  | attribute    | SKL      | `ResolveContext` | `I.C.Global` | notes |
+  ///  |--------------|-------------|------------------|-|-|
+  ///  | `global`     | `Global`    |             | global | |
+  ///  | `per_client` | `PerClient` |             | | |
+  ///  | `client`     | `PerClient` | `client`    | | |
+  ///  | `limited`    | `Limited`   | `limited`   | | |
+  ///  | `computed`:  | `None`      | `computed`  | | |
+  ///  | `server`     |             | `server`    | | usu. add `per_client`/`global` |
+  ///  | _default otherwise unspecified_ | _error_ | `ordinary` | not global |
+  ///
+  /// (Blank cells indicate that the attribute doesn't affect that output.)
+  ///
+  /// ## Resulting information for each field
+  ///
+  ///  * SKL of type `SectionKindList`, ends in up in `FIELDS`.
+  ///    Either `skl`, or exactly one of the SKL-setting attributes,
+  ///    must be provided.
+  ///
+  ///  * How to resolve it: which method on `ResolveContext` to call.
+  ///    Defaults to `ResolveContext::ordinary`.
+  ///
+  ///  * Whether to include the field in `InstanceConfigGlobal`.
+  ///    (`global`).
   ///
   /// Generated code
   ///