(group: &SettingGroup, parent: ParentGroup, fmt: &mut Formatter)
| 393 | } |
| 394 | |
| 395 | fn gen_group(group: &SettingGroup, parent: ParentGroup, fmt: &mut Formatter) { |
| 396 | // Generate struct. |
| 397 | fmtln!(fmt, "#[derive(Clone, PartialEq, Hash)]"); |
| 398 | fmt.doc_comment(format!("Flags group `{}`.", group.name)); |
| 399 | fmt.add_block("pub struct Flags", |fmt| { |
| 400 | fmtln!(fmt, "bytes: [u8; {}],", group.byte_size()); |
| 401 | }); |
| 402 | |
| 403 | gen_constructor(group, parent, fmt); |
| 404 | gen_iterator(group, fmt); |
| 405 | gen_enum_types(group, fmt); |
| 406 | gen_getters(group, fmt); |
| 407 | gen_descriptors(group, fmt); |
| 408 | gen_template(group, fmt); |
| 409 | gen_display(group, fmt); |
| 410 | gen_hash_key(fmt); |
| 411 | } |
| 412 | |
| 413 | pub(crate) fn generate( |
| 414 | settings: &SettingGroup, |
no test coverage detected