pub struct PersonAsk {
pub question: String,
pub choices: Vec<String>,
}Expand description
A question an agent puts to its person in its own words, answered with one of its choices. It waits on their devices until they answer. Nothing in it holds words of the person’s: what they want to say in their own words they say in the conversation.
Fields§
§question: StringThe question, as the agent words it.
choices: Vec<String>The answers the person picks from, in order: at least one.
Implementations§
Source§impl PersonAsk
impl PersonAsk
Sourcepub fn checked(self) -> Result<Self, String>
pub fn checked(self) -> Result<Self, String>
The question as it is put: trimmed, with its choices.
§Errors
What makes it no question to put: empty, too long, no choices (ASK_WITH_CHOICES), or
choices that are empty, repeated, too long or too many.
Sourcepub fn answered_by(&self, reply: &str) -> bool
pub fn answered_by(&self, reply: &str) -> bool
Whether reply answers it: one of its choices.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PersonAsk
impl<'de> Deserialize<'de> for PersonAsk
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 Eq for PersonAsk
impl StructuralPartialEq for PersonAsk
Auto Trait Implementations§
impl Forget for PersonAsk
impl Freeze for PersonAsk
impl Move for PersonAsk
impl RefUnwindSafe for PersonAsk
impl Send for PersonAsk
impl Sync for PersonAsk
impl Unpin for PersonAsk
impl UnsafeUnpin for PersonAsk
impl UnwindSafe for PersonAsk
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
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more