pub struct DomainEnumeration {
pub subject: QuestionReference,
pub values: Vec<EnumeratedValue>,
pub preamble: Option<LocalizedText>,
}Expand description
Every value one subject accepts, and nothing else.
Declared per view, so a workflow whose accepted values depend on the phase
or on the record declares what is true now rather than what is true in
general. See
WorkflowDefinition::enumerations for what the runtime does with it.
Fields§
§subject: QuestionReferenceThe field or concept, in the vocabulary a plan’s questions use.
values: Vec<EnumeratedValue>The complete set. A partial one would be worse than none: it would make the runtime state as exhaustive a list that is not.
preamble: Option<LocalizedText>A sentence to put before the values, in the workflow’s own words.
Optional, and server-authored like a receipt’s body. The runtime writes no sentence of its own here, because a sentence about a domain is the domain’s to write.
Implementations§
Source§impl DomainEnumeration
impl DomainEnumeration
Sourcepub fn new(
subject: impl Into<QuestionReference>,
values: Vec<EnumeratedValue>,
) -> Self
pub fn new( subject: impl Into<QuestionReference>, values: Vec<EnumeratedValue>, ) -> Self
A subject and the values it accepts.
Sourcepub fn with_preamble(self, preamble: LocalizedText) -> Self
pub fn with_preamble(self, preamble: LocalizedText) -> Self
Adds the sentence that introduces the values.
Trait Implementations§
Source§impl Clone for DomainEnumeration
impl Clone for DomainEnumeration
Source§impl Debug for DomainEnumeration
impl Debug for DomainEnumeration
Source§impl<'de> Deserialize<'de> for DomainEnumeration
impl<'de> Deserialize<'de> for DomainEnumeration
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 DomainEnumeration
Source§impl PartialEq for DomainEnumeration
impl PartialEq for DomainEnumeration
Source§impl Serialize for DomainEnumeration
impl Serialize for DomainEnumeration
impl StructuralPartialEq for DomainEnumeration
Auto Trait Implementations§
impl Freeze for DomainEnumeration
impl RefUnwindSafe for DomainEnumeration
impl Send for DomainEnumeration
impl Sync for DomainEnumeration
impl Unpin for DomainEnumeration
impl UnsafeUnpin for DomainEnumeration
impl UnwindSafe for DomainEnumeration
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.