pub struct Captured(_);
Expand description

Output captured from the terminal.

Implementations

Converts this terminal output to an HTML string.

The conversion applies styles by wrapping colored / styled text into spans with the following classes:

  • bold, italic, dimmed, underline are self-explanatory
  • fg0, fg1, …, fg15 are used to indicate indexed 4-bit ANSI color of the text. Indexes 0..=7 correspond to the ordinary color variations, and 8..=15 to the intense ones.
  • bg0, bg1, …, bg15 work similarly, but for the background color instead of text color.

Indexed ANSI colors with indexes >15 and ANSI RGB colors are rendered using the style attribute.

The output string retains whitespace of the input. Hence, it needs to be wrapped into a pre element or an element with the white-space CSS property set to pre in order to be displayed properly.

Errors

Returns an error if there was an issue processing output.

Converts this terminal output to plaintext.

Errors

Returns an error if there was an issue processing output.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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.