macro_rules! define_list_builder_accessors {
    {
        struct $OuterBuilder:ty {
            $(
                $( #[ doc= $fdoc1:tt ] $( #[ doc $($fdoc:tt)* ] )* )?
                $vis:vis $things:ident: [$EntryBuilder:ty],
            )*
        }
    } => { ... };
}
Expand description

Define accessor methods for a configuration item which is a list

See the list_builder module documentation for an overview.

Generates the following methods for each specified field:

impl $OuterBuilder {
    pub fn $things(&mut self) -> &mut Vec<$EntryBuilder> { .. }
    pub fn set_$things(&mut self, list: Vec<$EntryBuilder>) { .. }
    pub fn opt_$things(&self) -> &Option<Vec<$EntryBuilder>> { .. }
    pub fn opt_$things_mut>](&mut self) -> &mut Option<Vec<$EntryBuilder>> { .. }
}

Each $EntryBuilder should have been defined by define_list_builder_helper; the method bodies from this macro rely on facilities which will beprovided by that macro.

The entire first “paragraph” (summary line) of the docs in the macro argument should be on the first line (and should not contain a final full stop). The macro will provide some additional text about the generated methods. It is not normally useful to provide substantial docs on the actual field in the struct, since it won’t appear in public rustdoc output.

You can call define_list_builder_accessors once for a particular $OuterBuilder, with any number of fields with possibly different entry ($EntryBuilder) types.