pub struct DisagreementView {
pub id: String,
pub assessment: String,
pub discriminating_question: String,
pub resolution: Option<String>,
pub favours: Option<String>,
}Expand description
One disagreement, as the state reports it.
The view names the question that decides the disagreement and, once a resolution is recorded, the resolution and the position its evidence favoured. A view without a resolution is an unsettled disagreement that blocks its assessment.
use majordomus_cli::reasoning::state::{derive, DisagreementView};
use majordomus_cli::reasoning::store::Loaded;
let mut loaded = Loaded::default();
loaded.records.push(rec("disagreement-1", 1, json!({
"kind": "disagreement", "assessment": "assessment-0",
"positions": [
{ "source": "primary", "position": "A" },
{ "source": "consultation-9", "position": "B" },
],
"discriminating_question": "do callers retry?",
})));
loaded.records.push(rec("resolution-2", 2, json!({
"kind": "resolution", "disagreement": "disagreement-1",
"experiment": "read the callers", "outcome": "none retries",
"favours": "consultation-9",
"evidence": [{ "kind": "file", "reference": "src/caller.rs" }],
})));
let state = derive(&loaded, None);
let view: &DisagreementView = &state.disagreements[0];
assert_eq!(view.discriminating_question, "do callers retry?");
assert_eq!(view.resolution.as_deref(), Some("resolution-2"));
assert_eq!(view.favours.as_deref(), Some("consultation-9"));Fields§
§id: StringRecord id.
assessment: StringThe assessment.
discriminating_question: StringThe question that decides it.
resolution: Option<String>The resolution, when settled.
favours: Option<String>The position the evidence favoured.
Trait Implementations§
Source§impl Clone for DisagreementView
impl Clone for DisagreementView
Source§fn clone(&self) -> DisagreementView
fn clone(&self) -> DisagreementView
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 DisagreementView
impl Debug for DisagreementView
Source§impl<'de> Deserialize<'de> for DisagreementView
impl<'de> Deserialize<'de> for DisagreementView
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 DisagreementView
impl JsonSchema for DisagreementView
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 DisagreementView
impl RefUnwindSafe for DisagreementView
impl Send for DisagreementView
impl Sync for DisagreementView
impl Unpin for DisagreementView
impl UnsafeUnpin for DisagreementView
impl UnwindSafe for DisagreementView
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