pub struct OptMeta {Show 13 fields
pub opt: Opt,
pub keyword: &'static str,
pub label: &'static str,
pub group: &'static str,
pub default_on: bool,
pub paths: u8,
pub emits_unsafe: bool,
pub mem_class: MemClass,
pub cost: OptCost,
pub requires: &'static [Opt],
pub conflicts: &'static [Opt],
pub preempts: &'static [Opt],
pub scope: Scope,
}Expand description
One row of the optimization registry — the complete static description of a
single optimization. Adding an optimization means adding one Opt variant
and one row here; nothing else hardcodes the list.
Fields§
§opt: OptThe optimization this row describes.
keyword: &'static strThe ## No <Keyword> decorator word (lowercase, single token).
label: &'static strHuman-readable label for UIs.
group: &'static strWhich group the UI files this under.
default_on: boolWhether this optimization is on in the default (all-on, speed) config.
paths: u8Execution paths it affects (bitmask of path constants).
emits_unsafe: boolWhether enabling it can emit unsafe Rust (disabled by the Safety profile).
mem_class: MemClassIts memory/speed trade-off classification.
cost: OptCostHow expensive the pass is to run — the hotness tier at which the tiered
optimizer starts paying for it (HOTSWAP §3). For every row,
cost(requires) ≤ cost, so a tier that admits this opt admits its deps.
requires: &'static [Opt]Optimizations that must be on for this one to apply; if any is off,
normalize turns this one off too.
conflicts: &'static [Opt]Optimizations mutually exclusive with this one — GLOBAL exclusion (both on
→ normalize disables the later-declared). Distinct from preempts.
preempts: &'static [Opt]Optimizations this one takes PRECEDENCE over, per instance: when both are
enabled, this one is tried/applied first for a given function/loop/array/
map, and the listed ones act as the fallback for the instances it did not
claim. Both stay enabled (unlike conflicts); the listed optimization
fires only where this one declined. Disabling THIS one is what can let a
preempted optimization surface — the edge the menu-tree walks.
scope: ScopeWhere its decorator may appear.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OptMeta
impl RefUnwindSafe for OptMeta
impl Send for OptMeta
impl Sync for OptMeta
impl Unpin for OptMeta
impl UnsafeUnpin for OptMeta
impl UnwindSafe for OptMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.