Struct OptionOverrideSet
pub struct OptionOverrideSet { /* private fields */ }Expand description
A set of OptionOverrides contributed by one layer
producer (typically the return value of Mode::options()).
SmallVec keeps the typical case (0-4 overrides per mode)
inline; modes that contribute many overrides spill to the
heap. Layer-input data, not hot-path read data — the
resolver walks each set exactly once per
recompute_options call.
Implementations§
§impl OptionOverrideSet
impl OptionOverrideSet
pub fn new() -> OptionOverrideSet
pub fn new() -> OptionOverrideSet
An empty set — what a mode that overrides nothing returns.
pub fn with_capacity(cap: usize) -> OptionOverrideSet
pub fn with_capacity(cap: usize) -> OptionOverrideSet
An empty set with room for cap overrides before spilling
past the inline capacity (4).
pub fn push(&mut self, ov: OptionOverride)
pub fn push(&mut self, ov: OptionOverride)
Append an override. Order within a set is preserved; the resolver visits elements in this order when merging.
pub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of overrides in the set, duplicates included (two entries for one option count twice).
pub fn iter(&self) -> impl Iterator<Item = &OptionOverride>
pub fn iter(&self) -> impl Iterator<Item = &OptionOverride>
The overrides in push order — the order the resolver visits them in, so a later entry for the same option wins within the set (priority permitting).
Trait Implementations§
§impl Clone for OptionOverrideSet
impl Clone for OptionOverrideSet
§fn clone(&self) -> OptionOverrideSet
fn clone(&self) -> OptionOverrideSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more