Skip to main content

InteractionConfig

Struct InteractionConfig 

Source
#[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
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.
§default_ttl: Option<Duration>

Time to live given to cards the runtime creates. None means no expiry.

§max_selection_candidates: usize

How 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: bool

Whether 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: bool

Whether confirmation cards are invalidated by a revision change.

§restore_card_after_failed_command: bool

Whether 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

Source

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.

Source

pub const fn restoring_failed_cards(self) -> Self

Returns a copy that restores a card whose command failed.

Source

pub const fn with_default_ttl(self, ttl: Option<Duration>) -> Self

Returns a copy with another time to live.

Source

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

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 Copy for InteractionConfig

Source§

impl Debug for InteractionConfig

Source§

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

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

impl Default for InteractionConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for InteractionConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for InteractionConfig

Source§

impl PartialEq for InteractionConfig

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 Serialize for InteractionConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for InteractionConfig

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> AsOut<T> for T
where T: Copy,

Source§

fn as_out(&mut self) -> Out<'_, T>

Returns an out reference to self.
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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