pub struct Interaction { /* private fields */ }Expand description
One-time interaction with the terminal.
Implementations§
Source§impl Interaction
impl Interaction
Sourcepub fn new(input: impl Into<UserInput>, output: StyledString) -> Self
pub fn new(input: impl Into<UserInput>, output: StyledString) -> Self
Creates a new interaction.
Any newlines at the end of the output will be trimmed.
Sourcepub fn set_exit_status(&mut self, exit_status: Option<ExitStatus>)
pub fn set_exit_status(&mut self, exit_status: Option<ExitStatus>)
Sets an exit status for this interaction.
Sourcepub fn with_exit_status(self, exit_status: ExitStatus) -> Self
pub fn with_exit_status(self, exit_status: ExitStatus) -> Self
Assigns an exit status to this interaction.
Source§impl Interaction
impl Interaction
Sourcepub fn output(&self) -> &StyledString
pub fn output(&self) -> &StyledString
Output to the terminal.
Sourcepub fn set_output(&mut self, output: StyledString)
pub fn set_output(&mut self, output: StyledString)
Sets the output for this interaction.
Sourcepub fn exit_status(&self) -> Option<ExitStatus>
pub fn exit_status(&self) -> Option<ExitStatus>
Returns exit status of the interaction, if available.
Trait Implementations§
Source§impl Clone for Interaction
impl Clone for Interaction
Source§fn clone(&self) -> Interaction
fn clone(&self) -> Interaction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Interaction
impl Debug for Interaction
Source§impl Extend<Interaction> for Transcript
impl Extend<Interaction> for Transcript
Source§fn extend<I: IntoIterator<Item = Interaction>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Interaction>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Interaction> for Transcript
impl FromIterator<Interaction> for Transcript
Source§fn from_iter<I: IntoIterator<Item = Interaction>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = Interaction>>(iter: I) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for Interaction
impl RefUnwindSafe for Interaction
impl Send for Interaction
impl Sync for Interaction
impl Unpin for Interaction
impl UnwindSafe for Interaction
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.