#[non_exhaustive]pub struct InteractionConfig {
pub default_ttl: Option<Duration>,
pub max_selection_candidates: usize,
pub selection_cards_block_the_case: bool,
pub confirmation_cards_bind_to_revision: bool,
pub restore_card_after_failed_command: bool,
}Expand description
How server-created cards behave (spec §15).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.default_ttl: Option<Duration>Time to live given to cards the runtime creates. None means no expiry.
max_selection_candidates: usizeHow many candidates a server-defined selection card may offer.
Beyond this the act is rejected and the user is asked to narrow it down, rather than shown a truncated list — truncating would let list order decide which cases the user may pick, which is exactly what I8 forbids.
selection_cards_block_the_case: boolWhether a selection card owns unqualified answers for the case it is filed under (I5).
The default is false, and that is a considered choice. A card asking
“which of these did you mean?” has to be stored against some case row,
but the whole point is that nobody knows yet which case the user meant.
Letting it block that row would wedge a case the user may never have been
talking about, and would compete with the blocking card that case might
legitimately need. Turn it on only where a selection really does own the
conversation until it is answered.
confirmation_cards_bind_to_revision: boolWhether confirmation cards are invalidated by a revision change.
restore_card_after_failed_command: boolWhether a card whose command failed goes back to Active so the user
may answer again, instead of being recorded Failed (spec §15.5).
The default is false, and that is the careful reading. A command that
the domain refused, or that was planned against a revision the case has
left, will usually be refused again for the same reason; re-offering the
same button invites the user to keep pressing it. Turn it on where the
failure is genuinely transient and the card is still the right question.
Implementations§
Source§impl InteractionConfig
impl InteractionConfig
Sourcepub const fn conservative() -> Self
pub const fn conservative() -> Self
One-day expiry, at most 8 candidates, non-blocking selection cards, confirmations bound to the revision they were rendered against.
Sourcepub const fn restoring_failed_cards(self) -> Self
pub const fn restoring_failed_cards(self) -> Self
Returns a copy that restores a card whose command failed.
Sourcepub const fn with_default_ttl(self, ttl: Option<Duration>) -> Self
pub const fn with_default_ttl(self, ttl: Option<Duration>) -> Self
Returns a copy with another time to live.
Sourcepub const fn with_max_selection_candidates(self, max: usize) -> Self
pub const fn with_max_selection_candidates(self, max: usize) -> Self
Returns a copy with another candidate cap.
Trait Implementations§
Source§impl Clone for InteractionConfig
impl Clone for InteractionConfig
impl Copy for InteractionConfig
Source§impl Debug for InteractionConfig
impl Debug for InteractionConfig
Source§impl Default for InteractionConfig
impl Default for InteractionConfig
Source§impl<'de> Deserialize<'de> for InteractionConfig
impl<'de> Deserialize<'de> for InteractionConfig
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 InteractionConfig
Source§impl PartialEq for InteractionConfig
impl PartialEq for InteractionConfig
Source§impl Serialize for InteractionConfig
impl Serialize for InteractionConfig
impl StructuralPartialEq for InteractionConfig
Auto Trait Implementations§
impl Freeze for InteractionConfig
impl RefUnwindSafe for InteractionConfig
impl Send for InteractionConfig
impl Sync for InteractionConfig
impl Unpin for InteractionConfig
impl UnsafeUnpin for InteractionConfig
impl UnwindSafe for InteractionConfig
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.