Trait ToPretty

Source
pub trait ToPretty {
    type Output: Element;
    type Context;

    // Required method
    fn pretty<R: Repo>(
        &self,
        hi: &mut Highlighter,
        context: &Self::Context,
        repo: &R,
    ) -> Self::Output;
}
Expand description

Types that can be rendered as pretty diffs.

Required Associated Types§

Source

type Output: Element

The output of the render process.

Source

type Context

Context that can be passed down from parent objects during rendering.

Required Methods§

Source

fn pretty<R: Repo>( &self, hi: &mut Highlighter, context: &Self::Context, repo: &R, ) -> Self::Output

Render to pretty diff output.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ToPretty for DiffContent

Source§

type Output = VStack<'static>

Source§

type Context = Blobs<(PathBuf, Blob)>

Source§

fn pretty<R: Repo>( &self, hi: &mut Highlighter, blobs: &Self::Context, repo: &R, ) -> Self::Output

Source§

impl ToPretty for FileDiff

Source§

type Output = VStack<'static>

Source§

type Context = ()

Source§

fn pretty<R: Repo>( &self, hi: &mut Highlighter, _context: &Self::Context, repo: &R, ) -> Self::Output

Source§

impl ToPretty for Modification

Source§

type Output = Line

Source§

type Context = Blobs<Vec<Line>>

Source§

fn pretty<R: Repo>( &self, _hi: &mut Highlighter, blobs: &Blobs<Vec<Line>>, _repo: &R, ) -> Self::Output

Source§

impl ToPretty for Added

Source§

type Output = VStack<'static>

Source§

type Context = FileHeader

Source§

fn pretty<R: Repo>( &self, hi: &mut Highlighter, header: &Self::Context, repo: &R, ) -> Self::Output

Source§

impl ToPretty for Copied

Source§

type Output = VStack<'static>

Source§

type Context = FileHeader

Source§

fn pretty<R: Repo>( &self, hi: &mut Highlighter, _context: &Self::Context, repo: &R, ) -> Self::Output

Source§

impl ToPretty for Deleted

Source§

type Output = VStack<'static>

Source§

type Context = FileHeader

Source§

fn pretty<R: Repo>( &self, hi: &mut Highlighter, header: &Self::Context, repo: &R, ) -> Self::Output

Source§

impl ToPretty for Diff

Source§

type Output = VStack<'static>

Source§

type Context = ()

Source§

fn pretty<R: Repo>( &self, hi: &mut Highlighter, context: &Self::Context, repo: &R, ) -> Self::Output

Source§

impl ToPretty for Hunk<Modification>

Source§

type Output = VStack<'static>

Source§

type Context = Blobs<Vec<Line>>

Source§

fn pretty<R: Repo>( &self, hi: &mut Highlighter, blobs: &Self::Context, repo: &R, ) -> Self::Output

Source§

impl ToPretty for Modified

Source§

type Output = VStack<'static>

Source§

type Context = FileHeader

Source§

fn pretty<R: Repo>( &self, hi: &mut Highlighter, header: &Self::Context, repo: &R, ) -> Self::Output

Source§

impl ToPretty for Moved

Source§

type Output = VStack<'static>

Source§

type Context = FileHeader

Source§

fn pretty<R: Repo>( &self, hi: &mut Highlighter, header: &Self::Context, repo: &R, ) -> Self::Output

Implementors§