pub struct EconomicsFinding {
pub kind: String,
pub path: String,
pub line: Option<usize>,
pub detail: String,
}Expand description
One thing the check refuses. detail names the remedy, so a finding can be acted on
without reading the methodology. A finding about a claim or a file rather than a line
carries no line, and its JSON omits the key. The kinds:
unsupported_quantity: a number typed into hand-written prose next to the economics vocabulary.claim_unsupported: a claim binding that does not hold — the bound claim is missing fromdocs/CLAIMS.yaml, or it isguaranteedwhile its metric does not stand where the binding says or its evidence is not current.claim_unbound: aguaranteedclaim says tokens, context or cost go down and no binding ties it to a metric.claim_duplicate: one claim id appears more than once indocs/CLAIMS.yaml.declarations_unreadable: the benchmark declarations cannot be read, so no binding can be shown to hold.claims_unreadable:docs/CLAIMS.yamlexists and cannot be read or parsed.scan_failed: the prose could not be listed or a file in it could not be read, so nothing can be said to be clean.
use majordomus_cli::economics::claims::EconomicsFinding;
let finding = EconomicsFinding {
kind: "claim_unsupported".into(),
path: "docs/CLAIMS.yaml".into(),
line: None,
detail: "set the claim to planned, or record the evidence".into(),
};
let json = serde_json::to_value(&finding).unwrap();
assert!(json.get("line").is_none(), "no line, no key");
assert_eq!(serde_json::from_value::<EconomicsFinding>(json).unwrap(), finding);Fields§
§kind: Stringunsupported_quantity, claim_unsupported, claim_unbound, claim_duplicate,
declarations_unreadable, claims_unreadable or scan_failed.
path: StringRepository-relative path.
line: Option<usize>1-based line, when the finding is about a line.
detail: StringWhat was found, and what to do about it.
Trait Implementations§
Source§impl Clone for EconomicsFinding
impl Clone for EconomicsFinding
Source§fn clone(&self) -> EconomicsFinding
fn clone(&self) -> EconomicsFinding
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 EconomicsFinding
impl Debug for EconomicsFinding
Source§impl<'de> Deserialize<'de> for EconomicsFinding
impl<'de> Deserialize<'de> for EconomicsFinding
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 EconomicsFinding
Source§impl JsonSchema for EconomicsFinding
impl JsonSchema for EconomicsFinding
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 EconomicsFinding
impl PartialEq for EconomicsFinding
Source§fn eq(&self, other: &EconomicsFinding) -> bool
fn eq(&self, other: &EconomicsFinding) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EconomicsFinding
impl Serialize for EconomicsFinding
impl StructuralPartialEq for EconomicsFinding
Auto Trait Implementations§
impl Freeze for EconomicsFinding
impl RefUnwindSafe for EconomicsFinding
impl Send for EconomicsFinding
impl Sync for EconomicsFinding
impl Unpin for EconomicsFinding
impl UnsafeUnpin for EconomicsFinding
impl UnwindSafe for EconomicsFinding
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.