pub struct ReasoningState {
pub task: String,
pub assessments: Vec<AssessmentView>,
pub consultations: Vec<ConsultationView>,
pub disagreements: Vec<DisagreementView>,
pub conclusions: Vec<ConclusionView>,
pub timeline: Vec<ReasoningStep>,
pub totals: ReasoningTotals,
pub unreadable: Vec<String>,
}Expand description
The reasoning state of a task (or of every task).
It is what every surface reports: the assessments, consultations, disagreements and
conclusions of the task, the timeline of every record, the totals, and the store
files that could not be read. Derived by derive(), never stored.
use majordomus_cli::reasoning::state::{derive, ReasoningState};
use majordomus_cli::reasoning::store::Loaded;
let mut loaded = Loaded::default();
let assessment = |subject: &str| json!({ "kind": "assessment", "subject": subject });
loaded.records.push(rec("assessment-1", "t1", assessment("a")));
loaded.records.push(rec("assessment-2", "t2", assessment("b")));
loaded.unreadable.push("t2/broken.json".into());
let one: ReasoningState = derive(&loaded, Some("t1"));
assert_eq!((one.task.as_str(), one.assessments.len()), ("t1", 1));
let all = derive(&loaded, None);
assert_eq!((all.task.as_str(), all.totals.records), ("all", 2));
assert_eq!(all.unreadable, ["t2/broken.json"]);Fields§
§task: StringThe task reported, or all.
assessments: Vec<AssessmentView>The assessments.
consultations: Vec<ConsultationView>The consultations.
disagreements: Vec<DisagreementView>The disagreements.
conclusions: Vec<ConclusionView>The conclusions.
timeline: Vec<ReasoningStep>The timeline.
totals: ReasoningTotalsTotals.
unreadable: Vec<String>Store files that could not be read.
Trait Implementations§
Source§impl Clone for ReasoningState
impl Clone for ReasoningState
Source§fn clone(&self) -> ReasoningState
fn clone(&self) -> ReasoningState
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 ReasoningState
impl Debug for ReasoningState
Source§impl<'de> Deserialize<'de> for ReasoningState
impl<'de> Deserialize<'de> for ReasoningState
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 ReasoningState
impl JsonSchema for ReasoningState
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 ReasoningState
impl RefUnwindSafe for ReasoningState
impl Send for ReasoningState
impl Sync for ReasoningState
impl Unpin for ReasoningState
impl UnsafeUnpin for ReasoningState
impl UnwindSafe for ReasoningState
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