pub struct ProductionFlags {
pub global: Option<bool>,
pub dead_code: Option<bool>,
pub health: Option<bool>,
pub dupes: Option<bool>,
}Expand description
The production flags of a config load without a resolved run: the global
--production override and one override per analysis
(--production-dead-code, --production-health, --production-dupes).
The precedence is the precedence of the resolver without environment
variables: the flag of the analysis, then the global override, then the
config. A run of a surface decides the production mode in
crate::resolved_run; these flags serve the loads of
ConfigFile::for_analysis that have no run.
Fields§
§global: Option<bool>The global override. The CLI sets Some(true) for --production and
None without it. The programmatic API can also pass Some(false).
dead_code: Option<bool>Override for the dead-code analysis.
health: Option<bool>Override for the health analysis.
dupes: Option<bool>Override for the duplication analysis.
Implementations§
Source§impl ProductionFlags
impl ProductionFlags
Sourcepub const fn from_cli(
production: bool,
dead_code: Option<bool>,
health: Option<bool>,
dupes: Option<bool>,
) -> Self
pub const fn from_cli( production: bool, dead_code: Option<bool>, health: Option<bool>, dupes: Option<bool>, ) -> Self
The flags of a CLI run, where --production can only switch the mode
on.
Sourcepub const fn single_analysis_override(
production: bool,
own: Option<bool>,
) -> Option<bool>
pub const fn single_analysis_override( production: bool, own: Option<bool>, ) -> Option<bool>
The production override of a command that runs one analysis
(dead-code, dupes, health): its own override, else
--production. None means that the config decides.
Sourcepub const fn override_for(self, analysis: ProductionAnalysis) -> Option<bool>
pub const fn override_for(self, analysis: ProductionAnalysis) -> Option<bool>
The production override of one analysis: its own flag, else the global
override. None means that the config decides.
Sourcepub const fn mode(self, analysis: ProductionAnalysis) -> bool
pub const fn mode(self, analysis: ProductionAnalysis) -> bool
The production mode of one analysis as far as the flags decide, before
the config is loaded. A missing flag reads as false.
Sourcepub const fn modes(self) -> ProductionModes
pub const fn modes(self) -> ProductionModes
The production mode of each analysis as far as the flags decide.
Sourcepub fn effective(
self,
analysis: ProductionAnalysis,
config: &ProductionConfig,
) -> bool
pub fn effective( self, analysis: ProductionAnalysis, config: &ProductionConfig, ) -> bool
The effective production mode of one analysis: the flags first, then
the production setting of the config.
Trait Implementations§
Source§impl Clone for ProductionFlags
impl Clone for ProductionFlags
impl Copy for ProductionFlags
Source§impl Debug for ProductionFlags
impl Debug for ProductionFlags
Source§impl Default for ProductionFlags
impl Default for ProductionFlags
impl Eq for ProductionFlags
Source§impl PartialEq for ProductionFlags
impl PartialEq for ProductionFlags
impl StructuralPartialEq for ProductionFlags
Auto Trait Implementations§
impl Forget for ProductionFlags
impl Freeze for ProductionFlags
impl Move for ProductionFlags
impl RefUnwindSafe for ProductionFlags
impl Send for ProductionFlags
impl Sync for ProductionFlags
impl Unpin for ProductionFlags
impl UnsafeUnpin for ProductionFlags
impl UnwindSafe for ProductionFlags
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
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