pub struct FixedElicitation { /* private fields */ }Expand description
Answers every question the same way, and remembers what it was asked.
For tests, and as the shape an embedder copies: the second implementation
that makes Elicitation a contract rather than one type’s interface.
Implementations§
Source§impl FixedElicitation
impl FixedElicitation
pub fn new(answer: ElicitOutcome) -> Arc<Self> ⓘ
Sourcepub fn asked(&self) -> Vec<ElicitRequest>
pub fn asked(&self) -> Vec<ElicitRequest>
Every request put to it, in order.
Trait Implementations§
Source§impl Elicitation for FixedElicitation
impl Elicitation for FixedElicitation
Source§fn ask<'life0, 'async_trait>(
&'life0 self,
request: ElicitRequest,
) -> Pin<Box<dyn Future<Output = ElicitOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ask<'life0, 'async_trait>(
&'life0 self,
request: ElicitRequest,
) -> Pin<Box<dyn Future<Output = ElicitOutcome> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Put
request to a human and return their answer. Read moreSource§fn ask_within<'life0, 'async_trait>(
&'life0 self,
request: ElicitRequest,
within: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Option<ElicitOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ask_within<'life0, 'async_trait>(
&'life0 self,
request: ElicitRequest,
within: Option<Duration>,
) -> Pin<Box<dyn Future<Output = Option<ElicitOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn can_clarify(&self) -> bool
fn can_clarify(&self) -> bool
Whether a clarification asked here can reach a person. A session
whose elicitation cannot carry one is not offered
AskUserQuestion.Auto Trait Implementations§
impl !Freeze for FixedElicitation
impl Forget for FixedElicitation
impl Move for FixedElicitation
impl RefUnwindSafe for FixedElicitation
impl Send for FixedElicitation
impl Sync for FixedElicitation
impl Unpin for FixedElicitation
impl UnsafeUnpin for FixedElicitation
impl UnwindSafe for FixedElicitation
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