pub trait StyledFragmentTrait {
// Required methods
fn clone_frag(&self) -> StyledFragment;
fn emit_into_formatter(
&self,
f: &mut Formatter<'_>,
backend: &EmitBackend<'_>,
) -> EmitResult;
}
Expand description
A StyledFragmentTrait represents a fragment of content that can be emitted into an output stream (through an EmitBackend).
An implementation of StyledFragmentTrait must implement emit_into_formatter
, and gets default
implementations of emit_into
, which takes a fmt::Write
and a backend and writes into the
fmt::Write
, and emit_into_string
, which takes a backend and produces a String
.
In general, you should implement StyledFragmentTrait and store StyledFragment.