pub struct ReasoningFinding {
pub check: String,
pub subject: String,
pub message: String,
}Expand description
One finding of a reasoning check: which check, where, and what is wrong.
check is one of CHECKS; subject is a repository-relative path, a record id or
an advisor; message is one sentence saying what the rule refuses. Findings are
reported, never repaired.
use majordomus_cli::reasoning::catalogue::{AdvisorCatalogue, References};
use majordomus_cli::reasoning::check::{run, ReasoningFinding, CHECKS};
use majordomus_cli::reasoning::store::Loaded;
let root = tempfile::tempdir().unwrap();
let loaded = Loaded { records: vec![], unreadable: vec!["t/broken.json".into()] };
let found = run(root.path(), &AdvisorCatalogue::default(), &References::default(), &loaded);
let expected = ReasoningFinding {
check: "records".into(),
subject: "t/broken.json".into(),
message: "a reasoning record that does not parse".into(),
};
assert_eq!(found, [expected]);
assert!(CHECKS.contains(&found[0].check.as_str()));Fields§
§check: StringThe check that found it.
subject: StringWhere: a file, a record, an advisor.
message: StringWhat is wrong.
Trait Implementations§
Source§impl Clone for ReasoningFinding
impl Clone for ReasoningFinding
Source§fn clone(&self) -> ReasoningFinding
fn clone(&self) -> ReasoningFinding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ReasoningFinding
impl Debug for ReasoningFinding
Source§impl<'de> Deserialize<'de> for ReasoningFinding
impl<'de> Deserialize<'de> for ReasoningFinding
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
impl Eq for ReasoningFinding
Source§impl JsonSchema for ReasoningFinding
impl JsonSchema for ReasoningFinding
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ReasoningFinding
impl PartialEq for ReasoningFinding
Source§fn eq(&self, other: &ReasoningFinding) -> bool
fn eq(&self, other: &ReasoningFinding) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ReasoningFinding
impl Serialize for ReasoningFinding
impl StructuralPartialEq for ReasoningFinding
Auto Trait Implementations§
impl Freeze for ReasoningFinding
impl RefUnwindSafe for ReasoningFinding
impl Send for ReasoningFinding
impl Sync for ReasoningFinding
impl Unpin for ReasoningFinding
impl UnsafeUnpin for ReasoningFinding
impl UnwindSafe for ReasoningFinding
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.