pub struct MockPrompter {
pub responses: VecDeque<bool>,
}Expand description
Mock prompter with scripted boolean responses.
Fields§
§responses: VecDeque<bool>Scripted responses, consumed in order.
Implementations§
Source§impl MockPrompter
impl MockPrompter
Sourcepub fn new(responses: impl IntoIterator<Item = bool>) -> Self
pub fn new(responses: impl IntoIterator<Item = bool>) -> Self
Create a new mock from an iterator of boolean responses.
Trait Implementations§
Source§impl Default for MockPrompter
impl Default for MockPrompter
Source§fn default() -> MockPrompter
fn default() -> MockPrompter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MockPrompter
impl RefUnwindSafe for MockPrompter
impl Send for MockPrompter
impl Sync for MockPrompter
impl Unpin for MockPrompter
impl UnsafeUnpin for MockPrompter
impl UnwindSafe for MockPrompter
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> 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