Skip to main content

Finding

Enum Finding 

Source
pub enum Finding {
    Mismatch {
        key: String,
        current: Option<String>,
        expected: String,
        message: String,
        severity: Severity,
        attribution: Vec<Provenance>,
    },
    UnwritableRequiredKey {
        key: String,
        expected: String,
        attribution: Vec<Provenance>,
    },
    InvalidRequirements {
        key: String,
        message: String,
        contributors: Vec<(String, String)>,
    },
    ParseError {
        message: String,
        severity: Severity,
    },
    ConflictingRequirements {
        key: String,
        contributors: Vec<(String, String)>,
        reason: String,
    },
    InternalError {
        message: String,
    },
}
Expand description

A structured finding emitted by a FileEngine or a linter adapter.

Variants§

§

Mismatch

A key on disk disagrees with what the requirement asserts.

Fields

§current: Option<String>
§expected: String
§message: String

Free-form policy-authored explanation of the mismatch: what is wrong, why it’s wrong, what should be done instead. Comes from the assertion entry that produced this finding.

§severity: Severity
§attribution: Vec<Provenance>
§

UnwritableRequiredKey

Reconcile knew where to write but the file role forbids it.

Fields

§expected: String
§attribution: Vec<Provenance>
§

InvalidRequirements

The merged requirement set resolves per key but is JOINTLY unwritable: the tool itself would reject the resulting file, so the engine refuses to produce it. Always Severity::Error; hard failure; NOT waivable (there is no on-disk value to keep – the policy set is wrong).

Preference order before reaching for this variant:

  1. Make the invalidity unrepresentable in the requirement types where that is natural.
  2. Model a genuine either/or decision as ONE key, so the merge surfaces disagreement as ConflictingRequirements.
  3. Use this variant only for relational constraints across keys.

The Finding closed-set manifest row blocks ad hoc alternatives.

Fields

§key: String

The in-file key the constraint is anchored at.

§message: String

Which relational rule the set violates.

§contributors: Vec<(String, String)>

Each policy whose requirement participates in the invalid set.

§

ParseError

The file isn’t valid in its native grammar (e.g. malformed TOML).

Fields

§message: String
§severity: Severity
§

ConflictingRequirements

Two or more requirements disagree on the same key in the same file (the policies that issued them are the attribution). Produced by the engine’s merge phase, per key, naming each disagreeing policy and its value. Always Severity::Error; the field is dropped (not written); not waivable.

Fields

§key: String

The in-file key (e.g. [workspace.lints.clippy].unwrap_used).

§contributors: Vec<(String, String)>

Each disagreeing policy id + its rendered value.

§reason: String

Which rule fired (scalar-disagree / set-key-disagree / exact-mismatch).

§

InternalError

Engine- or adapter-internal failure (panic-class, but caught before it actually panics). Always Severity::Error.

Fields

§message: String

Trait Implementations§

Source§

impl Clone for Finding

Source§

fn clone(&self) -> Finding

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Finding

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.