pub enum ReasoningBody {
Assessment(AssessmentInput),
Plan(StoredPlan),
Consultation(ConsultationInput),
Disagreement(DisagreementInput),
Resolution(ResolutionInput),
Conclusion(StoredConclusion),
Validation(ValidationInput),
Attempt(AttemptInput),
}Expand description
A stored record’s body: the admitted input, with whatever the writer computed.
It mirrors ReasoningInput variant for variant, except that a plan is stored as a
StoredPlan and a conclusion as a StoredConclusion. Only the store produces one,
by admitting an input; its JSON form is tagged by kind like the input’s.
use majordomus_cli::reasoning::record::{AssessmentInput, ReasoningBody};
let body = ReasoningBody::Assessment(AssessmentInput {
subject: "lock scope".into(),
..Default::default()
});
assert_eq!(body.kind(), "assessment");
assert_eq!(serde_json::to_value(&body).unwrap()["kind"], "assessment");Variants§
Assessment(AssessmentInput)
A material uncertainty.
Plan(StoredPlan)
A plan, with its availability snapshot.
Consultation(ConsultationInput)
One advisor exchange.
Disagreement(DisagreementInput)
A disagreement.
Resolution(ResolutionInput)
A disagreement settled by evidence.
Conclusion(StoredConclusion)
An engineering conclusion, with its computed review.
Validation(ValidationInput)
A validation step performed.
Attempt(AttemptInput)
A failed attempt.
Implementations§
Source§impl ReasoningBody
impl ReasoningBody
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
The kind word, which is also the id prefix.
It is the same word as the serde kind tag, so a record’s id, its JSON and every
refusal that names its kind agree.
use majordomus_cli::reasoning::record::{AttemptInput, ReasoningBody};
let body = ReasoningBody::Attempt(AttemptInput {
assessment: None,
attempt: "inline the call".into(),
observed_failure: "the test still fails".into(),
assumption_invalidated: None,
evidence: vec![],
updated_hypothesis: None,
});
assert_eq!(body.kind(), "attempt");
assert_eq!(serde_json::to_value(&body).unwrap()["kind"], body.kind());Trait Implementations§
Source§impl Clone for ReasoningBody
impl Clone for ReasoningBody
Source§fn clone(&self) -> ReasoningBody
fn clone(&self) -> ReasoningBody
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 ReasoningBody
impl Debug for ReasoningBody
Source§impl<'de> Deserialize<'de> for ReasoningBody
impl<'de> Deserialize<'de> for ReasoningBody
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 ReasoningBody
impl JsonSchema for ReasoningBody
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 ReasoningBody
impl RefUnwindSafe for ReasoningBody
impl Send for ReasoningBody
impl Sync for ReasoningBody
impl Unpin for ReasoningBody
impl UnsafeUnpin for ReasoningBody
impl UnwindSafe for ReasoningBody
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