pub struct PlanRequest {
pub materiality: Materiality,
pub confidence: ReasoningConfidence,
pub capabilities: Vec<String>,
pub prior_conclusion: Option<String>,
pub new_evidence: bool,
}Expand description
What the policy is asked about: the materiality and confidence of one uncertainty, the advisory capabilities review needs, and any standing conclusion on the subject.
use majordomus_cli::reasoning::availability::{ModeResolution, ReasoningMode};
use majordomus_cli::reasoning::policy::{plan, PlanOutcome, PlanRequest};
let request: PlanRequest = serde_json::from_str(
r#"{"materiality":"high","confidence":"low","prior_conclusion":"conclusion-1"}"#,
).unwrap();
assert!(request.capabilities.is_empty() && !request.new_evidence);
let mode = ModeResolution { mode: ReasoningMode::Standard, source: "default".into() };
// a standing conclusion and no new evidence: reuse it rather than ask again
assert_eq!(plan(&request, &mode, &[]).outcome, PlanOutcome::ReusePrior);Fields§
§materiality: MaterialityMateriality of the uncertainty.
confidence: ReasoningConfidenceConfidence in the local hypothesis.
capabilities: Vec<String>The advisory capabilities review needs; empty means independent_reasoning.
prior_conclusion: Option<String>A standing conclusion on the same subject, when one exists.
new_evidence: boolThe assessment brings evidence the prior conclusion did not have.
Trait Implementations§
Source§impl Clone for PlanRequest
impl Clone for PlanRequest
Source§fn clone(&self) -> PlanRequest
fn clone(&self) -> PlanRequest
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 PlanRequest
impl Debug for PlanRequest
Source§impl Default for PlanRequest
impl Default for PlanRequest
Source§fn default() -> PlanRequest
fn default() -> PlanRequest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PlanRequest
impl<'de> Deserialize<'de> for PlanRequest
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 PlanRequest
impl JsonSchema for PlanRequest
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 PlanRequest
impl RefUnwindSafe for PlanRequest
impl Send for PlanRequest
impl Sync for PlanRequest
impl Unpin for PlanRequest
impl UnsafeUnpin for PlanRequest
impl UnwindSafe for PlanRequest
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