pub struct PlanInput {
pub assessment: String,
}Expand description
Ask the writer to make and record the plan for an assessment.
The input names only the assessment: the plan itself is computed by the store from the mode and the availability at the moment it is admitted, so a caller cannot write a plan that selects an advisor nobody could ask.
use majordomus_cli::reasoning::availability::{ModeResolution, ReasoningMode};
use majordomus_cli::reasoning::record::{PlanInput, ReasoningInput};
use majordomus_cli::reasoning::store::{admit, Admission, Loaded};
let mode = ModeResolution { mode: ReasoningMode::Standard, source: "default".into() };
let admission = Admission { mode: &mode, availability: &[] };
let input = ReasoningInput::Plan(PlanInput { assessment: "assessment-1".into() });
let refused = admit(input, &Loaded::default(), &admission).unwrap_err();
assert_eq!(refused.0, "no assessment assessment-1 is recorded");Fields§
§assessment: StringThe assessment the plan answers.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PlanInput
impl<'de> Deserialize<'de> for PlanInput
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 PlanInput
impl JsonSchema for PlanInput
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 PlanInput
impl RefUnwindSafe for PlanInput
impl Send for PlanInput
impl Sync for PlanInput
impl Unpin for PlanInput
impl UnsafeUnpin for PlanInput
impl UnwindSafe for PlanInput
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