[][src]Struct cranelift_codegen_meta::cdsl::settings::SettingGroupBuilder

pub(crate) struct SettingGroupBuilder {
    name: &'static str,
    settings: Vec<ProtoSetting>,
    presets: Vec<Preset>,
    predicates: Vec<ProtoPredicate>,
}

Fields

name: &'static strsettings: Vec<ProtoSetting>presets: Vec<Preset>predicates: Vec<ProtoPredicate>

Methods

impl SettingGroupBuilder[src]

pub fn new(name: &'static str) -> Self[src]

fn add_setting(
    &mut self,
    name: &'static str,
    comment: &'static str,
    specific: ProtoSpecificSetting
)
[src]

pub fn add_bool(
    &mut self,
    name: &'static str,
    comment: &'static str,
    default: bool
) -> BoolSettingIndex
[src]

pub fn add_enum(
    &mut self,
    name: &'static str,
    comment: &'static str,
    values: Vec<&'static str>
)
[src]

pub fn add_num(
    &mut self,
    name: &'static str,
    comment: &'static str,
    default: u8
)
[src]

pub fn add_predicate(&mut self, name: &'static str, node: PredicateNode)[src]

pub fn add_preset(
    &mut self,
    name: &'static str,
    args: Vec<PresetType>
) -> PresetIndex
[src]

pub fn build(self) -> SettingGroup[src]

Compute the layout of the byte vector used to represent this settings group.

The byte vector contains the following entries in order:

  1. Byte-sized settings like NumSetting and EnumSetting.
  2. BoolSetting settings.
  3. Precomputed named predicates.
  4. 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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.