Struct term_transcript::Captured
source · [−]pub struct Captured(_);
Expand description
Output captured from the terminal.
Implementations
sourceimpl Captured
impl Captured
sourcepub fn to_html(&self) -> Result<String, TermError>
pub fn to_html(&self) -> Result<String, TermError>
Converts this terminal output to an HTML string.
The conversion applies styles by wrapping colored / styled text into span
s with
the following class
es:
bold
,italic
,dimmed
,underline
are self-explanatoryfg0
,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.
Trait Implementations
impl TermOutput for Captured
Auto Trait Implementations
impl RefUnwindSafe for Captured
impl Send for Captured
impl Sync for Captured
impl Unpin for Captured
impl UnwindSafe for Captured
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more