pub struct ComponentMetricsLevers { /* private fields */ }Expand description
Effective per-component switch snapshot for the uniform component-operations family.
enabled is the master switch and components is the coarse default;
an override wins over components in both directions but can never
resurrect the family under the master switch:
enabled_for(C) = enabled && overrides.get(C).unwrap_or(components)Cloning is cheap: the overrides map is shared behind an Arc.
Implementations§
Source§impl ComponentMetricsLevers
impl ComponentMetricsLevers
Sourcepub fn new(
enabled: bool,
components: bool,
overrides: BTreeMap<String, bool>,
) -> Self
pub fn new( enabled: bool, components: bool, overrides: BTreeMap<String, bool>, ) -> Self
Builds a snapshot from the resolved master switch, the component default, and the per-component overrides.
Sourcepub fn uniform(components: bool) -> Self
pub fn uniform(components: bool) -> Self
Builds a snapshot with no overrides: components=true enables the
family for every component, components=false disables it
everywhere (including the master switch).
Sourcepub fn enabled_for(&self, component: &str) -> bool
pub fn enabled_for(&self, component: &str) -> bool
Resolves the effective switch for component.
Trait Implementations§
Source§impl Clone for ComponentMetricsLevers
impl Clone for ComponentMetricsLevers
Source§impl Debug for ComponentMetricsLevers
impl Debug for ComponentMetricsLevers
Auto Trait Implementations§
impl Freeze for ComponentMetricsLevers
impl RefUnwindSafe for ComponentMetricsLevers
impl Send for ComponentMetricsLevers
impl Sync for ComponentMetricsLevers
impl Unpin for ComponentMetricsLevers
impl UnsafeUnpin for ComponentMetricsLevers
impl UnwindSafe for ComponentMetricsLevers
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