[][src]Trait spectrum::StyledFragmentTrait

pub trait StyledFragmentTrait {
    fn clone_frag(&self) -> StyledFragment;
fn emit_into_formatter(
        &self,
        f: &mut Formatter<'_>,
        backend: &EmitBackend<'_>
    ) -> EmitResult; }

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.

Required methods

fn clone_frag(&self) -> StyledFragment

fn emit_into_formatter(
    &self,
    f: &mut Formatter<'_>,
    backend: &EmitBackend<'_>
) -> EmitResult

Loading content...

Implementors

impl StyledFragmentTrait for StyledLine[src]

impl StyledFragmentTrait for StyledNewline[src]

impl StyledFragmentTrait for StyledString[src]

Loading content...