MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / iter

Method iter

cranelift/codegen/src/settings.rs:170–191  ·  view source on GitHub ↗

Iterates the available settings in the builder.

(&self)

Source from the content-addressed store, hash-verified

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) {

Callers 1

parse_enum_valueFunction · 0.45

Calls 2

mapMethod · 0.45
enumsMethod · 0.45

Tested by

no test coverage detected