Struct term_transcript::Transcript [−][src]
pub struct Transcript<Out: TermOutput = Captured> { /* fields omitted */ }
Expand description
Transcript of a user interacting with the terminal.
Implementations
impl Transcript[src]
impl Transcript[src]pub fn from_inputs(
options: &mut ShellOptions,
inputs: impl IntoIterator<Item = UserInput>
) -> Result<Self>[src]
pub fn from_inputs(
options: &mut ShellOptions,
inputs: impl IntoIterator<Item = UserInput>
) -> Result<Self>[src]Constructs a transcript from the sequence of given user inputs.
The inputs are executed in the shell specified in options. A single shell is shared
among all commands.
Errors
- Returns an error if spawning the shell or any operations with it fail (such as reading stdout / stderr, or writing commands to stdin).
pub fn capture_output(
&mut self,
input: UserInput,
command: &mut Command
) -> Result<&mut Self>[src]
pub fn capture_output(
&mut self,
input: UserInput,
command: &mut Command
) -> Result<&mut Self>[src]Captures stdout / stderr of the provided command and adds it to Self::interactions().
The command is spawned with closed stdin. This method blocks until the command exits.
The method succeeds regardless of the exit status.
Errors
- Returns an error if spawning the
commandor any operations with it fail (such as reading stdout / stderr).
impl Transcript<Parsed>[src]
impl Transcript<Parsed>[src]pub fn from_svg<R: BufRead>(reader: R) -> Result<Self, ParseError>[src]
This is supported on crate feature test only.
pub fn from_svg<R: BufRead>(reader: R) -> Result<Self, ParseError>[src]test only.Parses a transcript from the provided reader, which should point to an SVG XML tree
produced by Template::render() (possibly within a larger document).
Errors
- Returns an error if the input cannot be parsed, usually because it was not produced
by
Template::render().
impl<Out: TermOutput> Transcript<Out>[src]
impl<Out: TermOutput> Transcript<Out>[src]pub fn interactions(&self) -> &[Interaction<Out>][src]
pub fn interactions(&self) -> &[Interaction<Out>][src]Returns interactions in this transcript.
impl Transcript[src]
impl Transcript[src]Trait Implementations
impl<Out: Clone + TermOutput> Clone for Transcript<Out>[src]
impl<Out: Clone + TermOutput> Clone for Transcript<Out>[src]fn clone(&self) -> Transcript<Out>[src]
fn clone(&self) -> Transcript<Out>[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl<Out: Debug + TermOutput> Debug for Transcript<Out>[src]
impl<Out: Debug + TermOutput> Debug for Transcript<Out>[src]impl<Out: TermOutput> Default for Transcript<Out>[src]
impl<Out: TermOutput> Default for Transcript<Out>[src]Auto Trait Implementations
impl<Out> RefUnwindSafe for Transcript<Out> where
Out: RefUnwindSafe,
Out: RefUnwindSafe,
impl<Out> Send for Transcript<Out>
impl<Out> Sync for Transcript<Out>
impl<Out> Unpin for Transcript<Out> where
Out: Unpin,
Out: Unpin,
impl<Out> UnwindSafe for Transcript<Out> where
Out: UnwindSafe,
Out: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more