pub struct CustomRule {
pub id: String,
pub name: String,
pub description: String,
pub severity: Severity,
pub category: FindingCategory,
pub match_spec: MatchSpec,
pub source_file: Option<PathBuf>,
}Expand description
A user-defined rule loaded from YAML. Fires when source, sink, and path predicates all match a propagation path produced by the engine.
Fields§
§id: String§name: String§description: String§severity: Severity§category: FindingCategory§match_spec: MatchSpec§source_file: Option<PathBuf>Path of the YAML file this rule was loaded from. Set by
load_rules_dir / parse_rules_multi_doc_with_source. Threaded into
every Finding this rule emits (FindingSource::Custom) so an
operator inspecting JSON / SARIF output can distinguish authentic
built-in findings from any rule that may have been planted in a
shared --invariants-dir. Defaults to None for rules constructed
in tests or in code paths that didn’t go through the loader.
Trait Implementations§
Source§impl Clone for CustomRule
impl Clone for CustomRule
Source§fn clone(&self) -> CustomRule
fn clone(&self) -> CustomRule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CustomRule
impl Debug for CustomRule
Source§impl<'de> Deserialize<'de> for CustomRule
impl<'de> Deserialize<'de> for CustomRule
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CustomRule
impl RefUnwindSafe for CustomRule
impl Send for CustomRule
impl Sync for CustomRule
impl Unpin for CustomRule
impl UnsafeUnpin for CustomRule
impl UnwindSafe for CustomRule
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