Struct term_transcript::Captured
source · pub struct Captured(_);
Expand description
Output captured from the terminal.
Implementations§
source§impl 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§
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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.