pub struct Evidence {
pub rule: Option<String>,
pub location: Option<String>,
pub found: String,
pub expected: Option<Expected>,
}Expand description
A single violation found during a check.
rule identifies what was violated, found shows what triggered it.
expected optionally carries what the check expected instead, when
the rule name alone isn’t enough to act on.
use scute_core::{Evidence, Expected};
let e = Evidence::with_expected(
"unknown-type",
"banana",
Expected::List(vec!["feat".into(), "fix".into()]),
);
assert_eq!(e.rule.as_deref(), Some("unknown-type"));
assert_eq!(e.found, "banana");
assert!(e.expected.is_some());Fields§
§rule: Option<String>§location: Option<String>§found: String§expected: Option<Expected>Implementations§
Trait Implementations§
impl StructuralPartialEq for Evidence
Auto Trait Implementations§
impl Freeze for Evidence
impl RefUnwindSafe for Evidence
impl Send for Evidence
impl Sync for Evidence
impl Unpin for Evidence
impl UnsafeUnpin for Evidence
impl UnwindSafe for Evidence
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