pub enum Confidence {
LocalBatch,
CiBatch,
DaemonStaging,
DaemonProduction,
}Expand description
Source context for a Finding: where and how it was produced.
perf-lint consumes this field via its runtime-findings import path and
uses it to adjust severity in the IDE. A daemon_production finding
(observed on real production traffic) is a much stronger signal than a
ci_batch finding (observed on a controlled integration test run with
limited traffic shapes).
Variants§
LocalBatch
Batch analyze run on a developer machine, no CI environment
detected. Lowest confidence: ad-hoc local traces, uncontrolled run.
CiBatch
Batch analyze run in CI (integration tests). Low confidence:
limited traffic shapes, controlled environment.
Marked #[default] so detectors that emit Confidence::default()
get a safe batch fallback, a forgotten stamp never inflates
perf-lint’s severity to a daemon level.
DaemonStaging
Daemon watch run on staging traffic. Medium confidence: real
patterns but not production scale.
DaemonProduction
Daemon watch run on production traffic. Highest confidence:
real patterns at real scale.
Implementations§
Source§impl Confidence
impl Confidence
Sourcepub const fn is_batch(&self) -> bool
pub const fn is_batch(&self) -> bool
true for the two batch contexts (local / CI). The terminal report
stays quiet about confidence for batch runs and only surfaces it for
the stronger daemon signals.
Sourcepub const fn batch_for_ci(is_ci: bool) -> Self
pub const fn batch_for_ci(is_ci: bool) -> Self
Pick the batch confidence from whether a CI environment was detected. Pure so the env detection (impure) stays at the call site.
Sourcepub const fn sarif_rank(&self) -> u32
pub const fn sarif_rank(&self) -> u32
Map confidence to a SARIF rank value (0-100).
Rank is SARIF v2.1.0’s standard “how much should this matter”
signal: 0 = low priority, 100 = highest. Populating it means
SARIF consumers that ignore the custom properties bag still
get a usable ordering.
Trait Implementations§
Source§impl Clone for Confidence
impl Clone for Confidence
Source§fn clone(&self) -> Confidence
fn clone(&self) -> Confidence
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Confidence
Source§impl Debug for Confidence
impl Debug for Confidence
Source§impl Default for Confidence
impl Default for Confidence
Source§fn default() -> Confidence
fn default() -> Confidence
Source§impl<'de> Deserialize<'de> for Confidence
impl<'de> Deserialize<'de> for Confidence
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Confidence
Source§impl Ord for Confidence
impl Ord for Confidence
Source§fn cmp(&self, other: &Confidence) -> Ordering
fn cmp(&self, other: &Confidence) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Confidence
impl PartialEq for Confidence
Source§impl PartialOrd for Confidence
impl PartialOrd for Confidence
Source§impl Serialize for Confidence
impl Serialize for Confidence
impl StructuralPartialEq for Confidence
Auto Trait Implementations§
impl Freeze for Confidence
impl RefUnwindSafe for Confidence
impl Send for Confidence
impl Sync for Confidence
impl Unpin for Confidence
impl UnsafeUnpin for Confidence
impl UnwindSafe for Confidence
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request