pub struct Group {
pub title: &'static str,
pub members: &'static [&'static str],
pub groups: &'static [Group],
pub when: Option<Relevance>,
pub selected_by: Option<Selection>,
}Expand description
One run of controls under a title, and the state that makes them relevant.
Fields§
§title: &'static str§members: &'static [&'static str]Registry paths, in reading order.
A member ending in .* is a nested body’s prefix and stands for every field that
body registers, in registry order — the whole of organ_a, without naming its
nineteen fields.
groups: &'static [Group]Groups within this one. Nesting has no depth limit; the layouts here go three deep at most, and a caller should recurse rather than assume.
when: Option<Relevance>What makes this group relevant, or None for a group that always is.
selected_by: Option<Selection>How this group is selected, where it is one of several stored alternatives such
as the two organ presets; None for a group that is not an alternative.
Implementations§
Source§impl Group
impl Group
Sourcepub fn is_relevant(&self, fields: &[Field]) -> bool
pub fn is_relevant(&self, fields: &[Field]) -> bool
Whether the instrument is using this group’s controls, for the state fields
holds.
⚠️ This answers for the group alone. A nested group is relevant only if its parent is too, and nothing here walks up to check — a caller recursing top-down has the answer already, and one starting in the middle does not have a group to start from.
Sourcepub fn members_of<'a>(&self, specs: &'a [FieldSpec]) -> Vec<&'a str>
pub fn members_of<'a>(&self, specs: &'a [FieldSpec]) -> Vec<&'a str>
This group’s own members, in reading order, with any prefix.* expanded against
the registry. Members of nested groups are not included.
A prefix.* names that body’s controls: a morph slot whose parameter the same
body declares is not one, because it is drawn on that parameter. A slot whose
parameter is missing has nothing to ride on and is named like any other field.
A member the body does not register is skipped rather than reported: the tests hold layouts to naming only real fields, so a caller need not carry the case.