Skip to main content

pedant_types/
finding.rs

1use std::sync::Arc;
2
3use serde::{Deserialize, Serialize};
4
5use crate::Capability;
6
7/// A source code location.
8#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
9pub struct SourceLocation {
10    /// File path relative to the crate root.
11    pub file: Arc<str>,
12    /// 1-based line number.
13    pub line: usize,
14    /// 1-based column number.
15    pub column: usize,
16}
17
18/// A single capability finding at a specific location.
19#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
20pub struct CapabilityFinding {
21    /// The capability detected.
22    pub capability: Capability,
23    /// Where in source the capability was found.
24    pub location: SourceLocation,
25    /// Human-readable evidence (e.g. the function call or expression).
26    pub evidence: Arc<str>,
27}