#[non_exhaustive]pub struct Choice {
pub instructions: Option<Value>,
pub criteria: IndexMap<String, Option<Value>>,
}Expand description
Pick one option from a set you define.
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.instructions: Option<Value>What the model should decide.
criteria: IndexMap<String, Option<Value>>Option label → description (None is sent as null: an undescribed option).
Implementations§
Source§impl Choice
impl Choice
Sourcepub fn new(instructions: impl Into<Value>) -> Self
pub fn new(instructions: impl Into<Value>) -> Self
A choice with instructions and no options yet; add them with Choice::option.
Sourcepub fn from_labels<I, S>(instructions: impl Into<Value>, labels: I) -> Self
pub fn from_labels<I, S>(instructions: impl Into<Value>, labels: I) -> Self
A choice between undescribed labels.
Trait Implementations§
impl StructuralPartialEq for Choice
Auto Trait Implementations§
impl Freeze for Choice
impl RefUnwindSafe for Choice
impl Send for Choice
impl Sync for Choice
impl Unpin for Choice
impl UnsafeUnpin for Choice
impl UnwindSafe for Choice
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
Mutably borrows from an owned value. Read more