Iterates the available settings in the builder.
(&self)
| 168 | |
| 169 | /// Iterates the available settings in the builder. |
| 170 | pub fn iter(&self) -> impl Iterator<Item = Setting> + use<> { |
| 171 | let template = self.template; |
| 172 | |
| 173 | template.descriptors.iter().map(move |d| { |
| 174 | let (kind, values) = match d.detail { |
| 175 | detail::Detail::Enum { last, enumerators } => { |
| 176 | let values = template.enums(last, enumerators); |
| 177 | (SettingKind::Enum, Some(values)) |
| 178 | } |
| 179 | detail::Detail::Num => (SettingKind::Num, None), |
| 180 | detail::Detail::Bool { .. } => (SettingKind::Bool, None), |
| 181 | detail::Detail::Preset => (SettingKind::Preset, None), |
| 182 | }; |
| 183 | |
| 184 | Setting { |
| 185 | name: d.name, |
| 186 | description: d.description, |
| 187 | kind, |
| 188 | values, |
| 189 | } |
| 190 | }) |
| 191 | } |
| 192 | |
| 193 | /// Set the value of a single bit. |
| 194 | fn set_bit(&mut self, offset: usize, bit: u8, value: bool) { |
no test coverage detected