pub(crate) struct SettingGroupBuilder {
name: &'static str,
settings: Vec<ProtoSetting>,
presets: Vec<Preset>,
predicates: Vec<ProtoPredicate>,
}
Fields§
§name: &'static str
§settings: Vec<ProtoSetting>
§presets: Vec<Preset>
§predicates: Vec<ProtoPredicate>
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_predicate(&mut self, name: &'static str, node: PredicateNode)
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
NumSetting
andEnumSetting
. BoolSetting
settings.- Precomputed named predicates.
- Other numbered predicates, including parent predicates that need to be accessible by number.
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.
Auto Trait Implementations§
impl Freeze for SettingGroupBuilder
impl RefUnwindSafe for SettingGroupBuilder
impl Send for SettingGroupBuilder
impl Sync for SettingGroupBuilder
impl Unpin for SettingGroupBuilder
impl UnwindSafe for SettingGroupBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more