pub struct Boolean { /* private fields */ }Expand description
A Boolean question with optional descriptions of each outcome.
Implementations§
Source§impl Boolean
impl Boolean
Sourcepub fn new(text: impl Into<String>) -> Result<Self, Error>
pub fn new(text: impl Into<String>) -> Result<Self, Error>
Validate instructions and construct a question without a confidence threshold.
§Errors
Returns InvalidQuestion when instructions are empty or contain only
reference-defined whitespace.
Sourcepub fn with_descriptions(self, yes: Option<String>, no: Option<String>) -> Self
pub fn with_descriptions(self, yes: Option<String>, no: Option<String>) -> Self
Set descriptions for true and false, respectively.
Sourcepub fn true_description(&self) -> Option<&str>
pub fn true_description(&self) -> Option<&str>
Description of the true outcome.
Sourcepub fn false_description(&self) -> Option<&str>
pub fn false_description(&self) -> Option<&str>
Description of the false outcome.
Source§impl Boolean
impl Boolean
Sourcepub fn instructions(&self) -> &str
pub fn instructions(&self) -> &str
Original instructions, preserved without trimming.
Sourcepub fn min_confidence(&self) -> f64
pub fn min_confidence(&self) -> f64
Minimum confidence required for a decision.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Boolean
impl<'de> Deserialize<'de> for Boolean
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Boolean
Auto Trait Implementations§
impl Freeze for Boolean
impl RefUnwindSafe for Boolean
impl Send for Boolean
impl Sync for Boolean
impl Unpin for Boolean
impl UnsafeUnpin for Boolean
impl UnwindSafe for Boolean
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