pub struct OverrideStack(/* private fields */);Expand description
A stack of OverrideMap values capturing our precedence rules.
Items toward the top of the stack (later in the backing Vec) have higher precedence
and override items lower in the stack. If an override is set and not None for a given lint
in multiple maps in the stack, the value at the top of the stack will be used
to calculate the effective lint level or required version update.
Implementations§
Source§impl OverrideStack
impl OverrideStack
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new, empty OverrideStack instance.
Sourcepub fn push(&mut self, item: &OverrideMap)
pub fn push(&mut self, item: &OverrideMap)
Inserts the given map at the top of the stack.
The inserted overrides will take precedence over any lower item in the stack,
if both maps have a not-None entry for a given lint.
Sourcepub fn effective_lint_level(&self, query: &SemverQuery) -> LintLevel
pub fn effective_lint_level(&self, query: &SemverQuery) -> LintLevel
Calculates the effective lint level of this query, by searching for an override mapped to this query’s id from the top of the stack first, returning the query’s default lint level if not overridden.
Sourcepub fn effective_required_update(
&self,
query: &SemverQuery,
) -> RequiredSemverUpdate
pub fn effective_required_update( &self, query: &SemverQuery, ) -> RequiredSemverUpdate
Calculates the effective required version bump of this query, by searching for an override mapped to this query’s id from the top of the stack first, returning the query’s default required version bump if not overridden.
Trait Implementations§
Source§impl Clone for OverrideStack
impl Clone for OverrideStack
Source§fn clone(&self) -> OverrideStack
fn clone(&self) -> OverrideStack
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OverrideStack
impl Debug for OverrideStack
Source§impl Default for OverrideStack
impl Default for OverrideStack
Source§fn default() -> OverrideStack
fn default() -> OverrideStack
Source§impl PartialEq for OverrideStack
impl PartialEq for OverrideStack
impl Eq for OverrideStack
impl StructuralPartialEq for OverrideStack
Auto Trait Implementations§
impl Freeze for OverrideStack
impl RefUnwindSafe for OverrideStack
impl Send for OverrideStack
impl Sync for OverrideStack
impl Unpin for OverrideStack
impl UnsafeUnpin for OverrideStack
impl UnwindSafe for OverrideStack
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more