pub struct Transcript<Out: TermOutput = Captured> { /* private fields */ }
Expand description

Transcript of a user interacting with the terminal.

Implementations

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), or if the shell exits before all commands are executed.

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 of the command.

Errors
  • Returns an error if spawning the command or any operations with it fail (such as reading stdout / stderr).
Available on crate feature 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().

Creates an empty transcript.

Returns interactions in this transcript.

Manually adds a new interaction to the end of this transcript.

This method allows capturing interactions that are difficult or impossible to capture using more high-level methods: Self::from_inputs() or Self::capture_output(). The resulting transcript will render just fine, but there could be issues with testing it.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.