pub struct ReasoningExplanation {
pub record: ReasoningRecord,
pub assessment: Option<String>,
pub chain: Vec<ReasoningStep>,
}Expand description
A record with everything it rests on and everything that rests on it.
It carries the record itself, the assessment it belongs to, and that assessment’s whole provenance chain as timeline steps in order. A record that belongs to no assessment has a chain of itself alone.
use majordomus_cli::reasoning::state::{explain, ReasoningExplanation};
use majordomus_cli::reasoning::store::Loaded;
let mut loaded = Loaded::default();
loaded.records.push(rec("attempt-1", 1, json!({
"kind": "attempt", "attempt": "inline it", "observed_failure": "still slow",
})));
let e: ReasoningExplanation = explain(&loaded, "attempt-1").unwrap();
assert_eq!(e.record.id, "attempt-1");
assert_eq!(e.assessment, None);
assert_eq!(e.chain.len(), 1);Fields§
§record: ReasoningRecordThe record asked about.
assessment: Option<String>The assessment it belongs to, when it belongs to one.
chain: Vec<ReasoningStep>Every record of that assessment, in order: its provenance chain.
Trait Implementations§
Source§impl Clone for ReasoningExplanation
impl Clone for ReasoningExplanation
Source§fn clone(&self) -> ReasoningExplanation
fn clone(&self) -> ReasoningExplanation
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 ReasoningExplanation
impl Debug for ReasoningExplanation
Source§impl<'de> Deserialize<'de> for ReasoningExplanation
impl<'de> Deserialize<'de> for ReasoningExplanation
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
Source§impl JsonSchema for ReasoningExplanation
impl JsonSchema for ReasoningExplanation
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 moreAuto Trait Implementations§
impl Freeze for ReasoningExplanation
impl RefUnwindSafe for ReasoningExplanation
impl Send for ReasoningExplanation
impl Sync for ReasoningExplanation
impl Unpin for ReasoningExplanation
impl UnsafeUnpin for ReasoningExplanation
impl UnwindSafe for ReasoningExplanation
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