pub(crate) struct SettingGroupBuilder {
name: &'static str,
settings: Vec<ProtoSetting>,
presets: Vec<Preset>,
}Fields§
§name: &'static str§settings: Vec<ProtoSetting>§presets: Vec<Preset>Implementations§
Source§impl SettingGroupBuilder
impl SettingGroupBuilder
pub fn new(name: &'static str) -> Self
fn add_setting( &mut self, name: &'static str, description: &'static str, comment: &'static str, specific: ProtoSpecificSetting, )
pub fn add_bool( &mut self, name: &'static str, description: &'static str, comment: &'static str, default: bool, ) -> BoolSettingIndex
pub fn add_enum( &mut self, name: &'static str, description: &'static str, comment: &'static str, values: Vec<&'static str>, )
pub fn add_num( &mut self, name: &'static str, description: &'static str, comment: &'static str, default: u8, )
pub fn add_preset( &mut self, name: &'static str, description: &'static str, args: Vec<PresetType>, ) -> PresetIndex
Sourcepub fn build(self) -> SettingGroup
pub fn build(self) -> SettingGroup
Compute the layout of the byte vector used to represent this settings group.
The byte vector contains the following entries in order:
- Byte-sized settings like
NumSettingandEnumSetting. BoolSettingsettings.
Set self.settings_size to the length of the byte vector prefix that
contains the settings. All bytes after that are computed, not
configured.
Set self.boolean_offset to the beginning of the numbered predicates,
2. in the list above.
Assign byte_offset and bit_offset fields in all settings.