pub struct ConfirmationSubject {
pub title: Option<LocalizedText>,
pub body: Option<LocalizedText>,
}Expand description
What a confirmation the policy engine raised is about, in the domain’s own words.
§The card nobody could write
An operation whose confirmation policy demands a click gets a card from the
policy engine, built from ConfirmationCopy: a title and two labels, all
per-kind. So every act in a deployment that needs a click and declares no
card of its own draws the same box. Asked to delete a draft, a user got
“Confermi?” over Cancel and Confirm, with nothing anywhere naming what was
about to be deleted.
It is the right card for the policy — a destructive act must be a click, and it was — and the wrong card for a person, who is being asked to confirm something the card does not name.
A workflow can already describe a card its projection declares, through
build_interaction. That door is shut for a confirmation the engine raises,
because there is no requirement to hang it on. This is the same door on that
path: the engine is the only layer that knows a confirmation is needed, and
the domain is the only one that knows what it is about.
Returning None keeps the generic box, so a workflow that says nothing sees
no change.
Fields§
§title: Option<LocalizedText>Replaces the per-kind title, when the domain has a better question.
body: Option<LocalizedText>Sets the body, which the generic card has none of.
Implementations§
Source§impl ConfirmationSubject
impl ConfirmationSubject
Sourcepub fn asking(title: LocalizedText) -> Self
pub fn asking(title: LocalizedText) -> Self
A confirmation that asks its own question.
Sourcepub fn describing(body: LocalizedText) -> Self
pub fn describing(body: LocalizedText) -> Self
A confirmation that keeps the generic question and explains underneath.
Sourcepub fn with_body(self, body: LocalizedText) -> Self
pub fn with_body(self, body: LocalizedText) -> Self
Adds a body to a question.
Trait Implementations§
Source§impl Clone for ConfirmationSubject
impl Clone for ConfirmationSubject
Source§impl Debug for ConfirmationSubject
impl Debug for ConfirmationSubject
Source§impl Default for ConfirmationSubject
impl Default for ConfirmationSubject
Source§impl<'de> Deserialize<'de> for ConfirmationSubject
impl<'de> Deserialize<'de> for ConfirmationSubject
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 ConfirmationSubject
Source§impl PartialEq for ConfirmationSubject
impl PartialEq for ConfirmationSubject
Source§impl Serialize for ConfirmationSubject
impl Serialize for ConfirmationSubject
impl StructuralPartialEq for ConfirmationSubject
Auto Trait Implementations§
impl Freeze for ConfirmationSubject
impl RefUnwindSafe for ConfirmationSubject
impl Send for ConfirmationSubject
impl Sync for ConfirmationSubject
impl Unpin for ConfirmationSubject
impl UnsafeUnpin for ConfirmationSubject
impl UnwindSafe for ConfirmationSubject
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.