pub struct MockTerminal { /* private fields */ }Expand description
Mock terminal for testing prompts.
Implementations§
Source§impl MockTerminal
impl MockTerminal
Sourcepub fn non_terminal() -> Self
pub fn non_terminal() -> Self
Create a mock that simulates a non-terminal.
Sourcepub fn with_response(response: impl Into<String>) -> Self
pub fn with_response(response: impl Into<String>) -> Self
Create a mock terminal that returns the given response.
Sourcepub fn with_responses(
responses: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_responses( responses: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Create a mock terminal that returns multiple responses in sequence.
Useful for testing retry scenarios.
Trait Implementations§
Source§impl Clone for MockTerminal
impl Clone for MockTerminal
Source§impl Debug for MockTerminal
impl Debug for MockTerminal
Source§impl TerminalIO for MockTerminal
impl TerminalIO for MockTerminal
Auto Trait Implementations§
impl !Freeze for MockTerminal
impl RefUnwindSafe for MockTerminal
impl Send for MockTerminal
impl Sync for MockTerminal
impl Unpin for MockTerminal
impl UnsafeUnpin for MockTerminal
impl UnwindSafe for MockTerminal
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,
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