pub struct ReceiptSummary {
pub receipt_id: ReceiptId,
pub status_code: String,
pub severity: ReceiptSeverity,
pub event_ids: Vec<EventId>,
pub title: String,
pub body: String,
}Expand description
A receipt as summarized for the narrator.
Fields§
§receipt_id: ReceiptIdThe receipt.
status_code: StringStatus code.
severity: ReceiptSeveritySeverity.
event_ids: Vec<EventId>Events behind it.
title: StringThe receipt’s own title, in the reader’s locale.
§Why the narrator is shown the copy and not only the code
A status code says that something happened; it does not say what. A
narrator given firm.field_set and nothing else can only write
the sentence that is true of any such event — that a datum was noted —
while the receipt rendered directly beneath the prose says which field
took which value. The reader gets an acknowledgement that is vaguer than
the block under it, from the same turn.
This does not widen what the narrator may claim. The receipt is already on screen, already passed the claim guard, and is already backed by the events it cites; letting the prose above it say the same thing is restating a claim the server has made, not making a new one.
body: StringThe receipt’s own body, in the reader’s locale. See Self::title.
Implementations§
Source§impl ReceiptSummary
impl ReceiptSummary
Sourcepub fn of(receipt: &OperationalReceipt, locale: &Locale) -> Self
pub fn of(receipt: &OperationalReceipt, locale: &Locale) -> Self
Summarizes receipt for a reader of locale.
The copy is resolved here rather than carried as
crate::locale::LocalizedText so that what the
narrator reads is exactly the string the reader will see below it. Two
renderings of one receipt in one turn is the failure this avoids.
Trait Implementations§
Source§impl Clone for ReceiptSummary
impl Clone for ReceiptSummary
Source§impl Debug for ReceiptSummary
impl Debug for ReceiptSummary
Source§impl<'de> Deserialize<'de> for ReceiptSummary
impl<'de> Deserialize<'de> for ReceiptSummary
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 ReceiptSummary
Source§impl PartialEq for ReceiptSummary
impl PartialEq for ReceiptSummary
Source§impl Serialize for ReceiptSummary
impl Serialize for ReceiptSummary
impl StructuralPartialEq for ReceiptSummary
Auto Trait Implementations§
impl Freeze for ReceiptSummary
impl RefUnwindSafe for ReceiptSummary
impl Send for ReceiptSummary
impl Sync for ReceiptSummary
impl Unpin for ReceiptSummary
impl UnsafeUnpin for ReceiptSummary
impl UnwindSafe for ReceiptSummary
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.