Skip to main content

NoticeCopy

Struct NoticeCopy 

Source
#[non_exhaustive]
pub struct NoticeCopy {
Show 39 fields pub nothing_submitted: LocalizedText, pub nothing_deleted: LocalizedText, pub draft_only: LocalizedText, pub no_external_effects: LocalizedText, pub partial_result: LocalizedText, pub select_target_title: LocalizedText, pub select_target_cancel: LocalizedText, pub condition_title: LocalizedText, pub condition_yes: LocalizedText, pub condition_no: LocalizedText, pub act_refused: LocalizedText, pub target_policy_mismatch: LocalizedText, pub target_unauthorized: LocalizedText, pub target_missing: LocalizedText, pub target_stale: LocalizedText, pub target_unresolved: LocalizedText, pub target_too_many_candidates: LocalizedText, pub several_open_cases: LocalizedText, pub no_active_interaction: LocalizedText, pub text_resolution_not_allowed: LocalizedText, pub unknown_option: LocalizedText, pub unknown_workflow: LocalizedText, pub unknown_operation: LocalizedText, pub already_answered_running: LocalizedText, pub already_answered_done: LocalizedText, pub already_answered_failed: LocalizedText, pub already_answered_closed: LocalizedText, pub invalid_arguments: LocalizedText, pub not_proposable: LocalizedText, pub blocked_by_mode: LocalizedText, pub forbidden_risk_class: LocalizedText, pub human_review_required: LocalizedText, pub prerequisite_not_done: LocalizedText, pub record_not_found: LocalizedText, pub record_not_found_yet: LocalizedText, pub record_not_unique: LocalizedText, pub not_understood: LocalizedText, pub message_unreadable: LocalizedText, pub kept_unchanged: LocalizedText,
}
Expand description

Server-authored copy for everything the reducer writes itself.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§nothing_submitted: LocalizedText

Body of the notice::NOTHING_SUBMITTED notice.

§nothing_deleted: LocalizedText

Body of the notice::NOTHING_DELETED notice.

§draft_only: LocalizedText

Body of the notice::DRAFT_ONLY notice.

§no_external_effects: LocalizedText

Body of the notice::NO_EXTERNAL_EFFECTS notice.

§partial_result: LocalizedText

Body of the notice::PARTIAL_RESULT notice.

§select_target_title: LocalizedText

Title of a selection card.

§select_target_cancel: LocalizedText

Label of the “none of these” option on a selection card.

§condition_title: LocalizedText

Title of the card an ApplyOnlyIf constraint raises.

§condition_yes: LocalizedText

Label of the “yes, apply it” option on that card.

§condition_no: LocalizedText

Label of the “no, leave it” option on that card.

§act_refused: LocalizedText

Body of the notice::ACT_REFUSED notice, for a domain rejection that carried no explanation. Deliberately vague: a workflow that wants the user told why uses DomainRejection::with_explanation. The runtime’s own refusals have their own fields below.

§target_policy_mismatch: LocalizedText

The act aimed at a shape the operation does not accept.

§target_unauthorized: LocalizedText

The handle named a record this actor may not reach.

§target_missing: LocalizedText

Nothing matched the record the act named.

§target_stale: LocalizedText

The record moved on since the handle was issued.

§target_unresolved: LocalizedText

The target resolved to something the reducer cannot use.

§target_too_many_candidates: LocalizedText

Too many records matched to offer an honest choice.

§several_open_cases: LocalizedText

The workflow the act would start already has more than one case open.

§no_active_interaction: LocalizedText

The act addressed the card on screen and there is none.

§text_resolution_not_allowed: LocalizedText

The card may not be answered by typing.

§unknown_option: LocalizedText

The option named is not one the card offers.

§unknown_workflow: LocalizedText

The act named a workflow this deployment does not run.

§unknown_operation: LocalizedText

The act named an operation this turn does not offer.

§already_answered_running: LocalizedText

The card was clicked again while its first answer is still running.

§already_answered_done: LocalizedText

The card was clicked again after its first answer had committed.

§already_answered_failed: LocalizedText

The card was clicked again after its first answer had failed.

§already_answered_closed: LocalizedText

The card was clicked again after it had been closed without doing the work it offered.

§invalid_arguments: LocalizedText

The act’s arguments are not what the operation takes.

§not_proposable: LocalizedText

The act named an operation only a card may run.

§blocked_by_mode: LocalizedText

The orchestration mode may not carry this risk class.

§forbidden_risk_class: LocalizedText

The configuration forbids this risk class outright.

§human_review_required: LocalizedText

Someone other than the user has to authorize this.

§prerequisite_not_done: LocalizedText

An act needed a record another act opens, and that act did not run.

§record_not_found: LocalizedText

Why a record the user named is asked for again: none is called that. {workflow} and {named} are replaced.

§record_not_found_yet: LocalizedText

The same, when none is called that and one can be registered now.

§record_not_unique: LocalizedText

The same, when several are called that.

§not_understood: LocalizedText

Words that produced nothing to act on; {words} is replaced by them.

§message_unreadable: LocalizedText

The whole message could not be read.

§kept_unchanged: LocalizedText

Acts left alone as the user asked; {words} is replaced by the words asking it.

Implementations§

Source§

impl NoticeCopy

Source

pub fn standard() -> Self

The built-in copy: English, with Italian.

Source

pub fn english() -> Self

English alone.

Source

pub fn already_answered(&self, progress: AnswerProgress) -> &LocalizedText

What a user is told when they click a card that was already answered.

Source

pub fn runtime_refusal( &self, code: &str, ) -> Option<(&'static str, &LocalizedText)>

The notice code and body for a refusal the runtime decided, or None when the code is not one of its own.

The returned code is the rejection’s own, not notice::ACT_REFUSED, and that is the point of the pair. Notices are deduplicated by code, so a turn in which one act named a record nobody could find and another answered a card that is not on screen used to reach the user as a single sentence covering neither. Now it reaches them as two, each keyed on a code an application can style, translate or route on.

Trait Implementations§

Source§

impl Clone for NoticeCopy

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NoticeCopy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NoticeCopy

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for NoticeCopy

Source§

impl PartialEq for NoticeCopy

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl ServerCopy for NoticeCopy

Source§

fn name(&self) -> &'static str

The copy’s name, for a report.
Source§

fn entries(&self) -> Vec<(&'static str, &LocalizedText)>

Every sentence, by the name of its field.
Source§

fn entries_mut(&mut self) -> Vec<(&'static str, &mut LocalizedText)>

Every sentence, to change in place.
Source§

fn translated(self, locale: impl Into<Locale>, texts: &[(&str, &str)]) -> Self
where Self: Sized,

Lays texts, by field name, over this copy as its text in locale: a new language, or the built-in one replaced. A field left out keeps what it had.
Source§

impl StructuralPartialEq for NoticeCopy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more