pub struct Finding {
pub name: String,
pub severity: RuleSeverity,
pub subject: String,
pub target: Option<String>,
pub graphs: Vec<String>,
pub message: String,
}Expand description
A v0.8 check finding over the composed graph. Serializes to the diagnostic
shape {name, severity, subject, target?, _graphs, message}: subject is the
implicated path (the source node for edge-level findings), target is the
edge’s destination on edge-level findings (absent on node-level ones), and
_graphs carries the same provenance key the node or edge does, so a consumer
never has to parse anything.
Fields§
§name: String§severity: RuleSeverity§subject: String§target: Option<String>§graphs: Vec<String>§message: StringImplementations§
Source§impl Finding
impl Finding
Sourcepub fn warn(
name: impl Into<String>,
subject: impl Into<String>,
graphs: Vec<String>,
message: impl Into<String>,
) -> Self
pub fn warn( name: impl Into<String>, subject: impl Into<String>, graphs: Vec<String>, message: impl Into<String>, ) -> Self
A finding at the default warn severity. The check orchestrator applies
the configured severity afterward.
Sourcepub fn with_target(self, target: impl Into<String>) -> Self
pub fn with_target(self, target: impl Into<String>) -> Self
Attach the destination path for an edge-level finding; renders as
subject → target and serializes as a target field.
pub fn format_text(&self) -> String
pub fn format_text_color(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Finding
impl RefUnwindSafe for Finding
impl Send for Finding
impl Sync for Finding
impl Unpin for Finding
impl UnsafeUnpin for Finding
impl UnwindSafe for Finding
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