pub struct StateField {
pub field: String,
pub value: Value,
pub identifying: bool,
}Expand description
One value a case holds, as the stage that ANSWERS may state it.
§Why a workflow declares this and the runtime does not read it
The composer knows what every case still NEEDS — obligations travel on the view and reach the writer as facts — and nothing at all about what it already HAS. So a question the user asks about their own record («what did you save as the company name?») arrives at the answering stage with the list of missing fields, the sources, and no answer in it. What comes back is «nothing is set», in good faith, over a record that holds the value.
The state itself cannot be handed over wholesale: it is the workflow’s own
type, it may carry values a person must not be told back, and a JSON dump is
not a fact. So the workflow says which of its values are sayable and under
which name, and the runtime turns each into a
NarratableFact::StateValue
— the variant that has existed for exactly this and that nothing filled.
Returning nothing, the default, keeps the previous behaviour.
Fields§
§field: StringThe path the workflow names it with.
value: ValueThe value, as the writer may state it.
identifying: boolWhether it tells this record apart from others of its workflow, such as a number or a counterpart’s name. Identifying fields are what a record is shown by when the model has to choose among several.
Implementations§
Source§impl StateField
impl StateField
Trait Implementations§
Source§impl Clone for StateField
impl Clone for StateField
Source§impl Debug for StateField
impl Debug for StateField
Source§impl<'de> Deserialize<'de> for StateField
impl<'de> Deserialize<'de> for StateField
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>,
impl Eq for StateField
Source§impl PartialEq for StateField
impl PartialEq for StateField
Source§impl Serialize for StateField
impl Serialize for StateField
impl StructuralPartialEq for StateField
Auto Trait Implementations§
impl Freeze for StateField
impl RefUnwindSafe for StateField
impl Send for StateField
impl Sync for StateField
impl Unpin for StateField
impl UnsafeUnpin for StateField
impl UnwindSafe for StateField
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.