pub struct AssessmentView {
pub id: String,
pub task: String,
pub subject: String,
pub materiality: Materiality,
pub standing: AssessmentStanding,
pub conclusion: Option<String>,
pub questions: Vec<String>,
}Expand description
One assessment and where it stands.
The view carries what a reader needs to pick the work up: the subject, its materiality, its derived standing, the conclusion that stands for it and the questions it left open.
use majordomus_cli::reasoning::policy::Materiality;
use majordomus_cli::reasoning::state::{derive, AssessmentView};
use majordomus_cli::reasoning::store::Loaded;
let mut loaded = Loaded::default();
loaded.records.push(rec("assessment-1", 1, json!({
"kind": "assessment", "subject": "lock scope", "materiality": "trivial",
"questions": ["is it held across an await?"],
})));
let state = derive(&loaded, None);
let view: &AssessmentView = &state.assessments[0];
assert_eq!((view.id.as_str(), view.task.as_str()), ("assessment-1", "t"));
assert_eq!(view.materiality, Materiality::Trivial);
assert_eq!(view.conclusion, None);
assert_eq!(view.questions, ["is it held across an await?"]);Fields§
§id: StringRecord id.
task: StringThe task it was recorded under.
subject: StringWhat is uncertain.
materiality: MaterialityHow much it matters.
standing: AssessmentStandingWhere it stands.
conclusion: Option<String>Its standing conclusion.
questions: Vec<String>Questions it left open.
Trait Implementations§
Source§impl Clone for AssessmentView
impl Clone for AssessmentView
Source§fn clone(&self) -> AssessmentView
fn clone(&self) -> AssessmentView
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 AssessmentView
impl Debug for AssessmentView
Source§impl<'de> Deserialize<'de> for AssessmentView
impl<'de> Deserialize<'de> for AssessmentView
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 AssessmentView
impl JsonSchema for AssessmentView
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 AssessmentView
impl RefUnwindSafe for AssessmentView
impl Send for AssessmentView
impl Sync for AssessmentView
impl Unpin for AssessmentView
impl UnsafeUnpin for AssessmentView
impl UnwindSafe for AssessmentView
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