chiark / gitweb /
config: get global config, macro doc
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Aug 2021 21:50:39 +0000 (22:50 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Aug 2021 21:50:39 +0000 (22:50 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
macros/macros.rs

index ee79e075ef7d71ba64508f1625538d8efac4a538..6413499a2df45b5471d6f70b7bed756f533c665c 100644 (file)
@@ -46,8 +46,13 @@ use itertools::Itertools;
 ///   }
 /// }
 ///
-/// pub struct InstanceConfigCommon {
-/// {
+/// pub struct InstanceConfigCommon { ... }
+/// impl InstanceConfigCommon {
+///   pub fn from(l: &[InstanceConfig]) { InstanceConfigCommon {
+///     field: <Type as ResolveGlobal>::resolve(l.iter().map(|e| &e.field)),
+///     ...
+///   } }
+/// }
 /// ```
 #[proc_macro_derive(ResolveConfig, attributes(
   limited, server, client, computed, special,