Skip to main content

ApprovalDecisionInput

Struct ApprovalDecisionInput 

Source
pub struct ApprovalDecisionInput {
    pub choice_id: String,
    pub feedback: Option<String>,
}
Expand description

The caller’s answer to one server-authored approval request.

Fields§

§choice_id: String

One of the choice ids the request offers. Any other is refused: the session sends the offered Denied choice, else the offered Abort choice, and fails the approval’s turn with a MuseError::Protocol carrying the ApprovalRoutingError::UnofferedChoice message once the host accepts that answer, or at once when neither is offered. For a stage the session already knows the host resolved or moved past, it sends nothing and fails no turn, and a -32051 or -32053 reply to the rejecting choice fails none either. An approval the session already retired for its own fault is not one the host moved past: its turn fails at once, unless the session has already received the host’s resolution, and if that fault comes while the rejecting choice is out, a -32053 reply fails it too.

§feedback: Option<String>

Free-text guidance delivered to the model with the decision, never stored durably. Set it only on a choice whose accepts_feedback is true: on any other choice the SDK refuses the decision before sending it, as it does an unoffered choice. The session sends the offered Denied choice, else the offered Abort choice, and nothing when neither is offered, and the approval’s turn fails with a MuseError::Protocol carrying the ApprovalRoutingError::FeedbackNotAccepted message when and as choice_id says an unoffered choice’s turn fails.

Trait Implementations§

Source§

impl Clone for ApprovalDecisionInput

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 ApprovalDecisionInput

Source§

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

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

impl Eq for ApprovalDecisionInput

Source§

impl PartialEq for ApprovalDecisionInput

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 StructuralPartialEq for ApprovalDecisionInput

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.