Struct term_transcript::svg::SerializedInteraction
source · #[non_exhaustive]pub struct SerializedInteraction<'a> {
pub input: &'a UserInput,
pub output_html: String,
pub exit_status: Option<i32>,
pub failure: bool,
/* private fields */
}Available on crate feature
svg only.Expand description
Serializable version of Interaction.
§HTML output
An interaction contains rendered HTML for the output with styles applied
to the relevant segments as <span>s. The styles are signalled using classes
and inline styles:
fg0–fg15classes specify the foreground color being 0th–15th base terminal color.fg0–fg7are ordinary colors, andfg8–fg15are intense variations.- Likewise,
bg0–bg15classes specify the background color as one of the base terminal colors. - Remaining indexed colors and 24-bit colors have a definite value, and thus are signalled
via an inline
style(e.g.,color: #c0ffeeorbackground: #c0ffee). bold,italic,underline,dimmedclasses correspond to the corresponding text styles.- Hard breaks, if they are enabled, are represented by
<b class="hard-br"><br/></b>.
The rendered HTML is assumed to be included into a container that preserves whitespace,
i.e., has white-space CSS property set to pre. An example of such container is <pre>.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.input: &'a UserInputUser’s input.
output_html: StringTerminal output in the HTML format.
exit_status: Option<i32>Exit status of the latest executed program, or None if it cannot be determined.
failure: boolWas execution unsuccessful judging by the ExitStatus?
Trait Implementations§
source§impl<'a> Debug for SerializedInteraction<'a>
impl<'a> Debug for SerializedInteraction<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for SerializedInteraction<'a>
impl<'a> Send for SerializedInteraction<'a>
impl<'a> Sync for SerializedInteraction<'a>
impl<'a> Unpin for SerializedInteraction<'a>
impl<'a> UnwindSafe for SerializedInteraction<'a>
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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§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.source§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.