Trait Encode

Source
pub trait Encode: Sized {
    // Required method
    fn encode(&self, w: &mut Writer<'_>) -> Result<(), Error>;

    // Provided method
    fn to_unified_string(&self) -> Result<String, Error> { ... }
}
Expand description

Diff-related types that can be encoded intro the unified diff format.

Required Methods§

Source

fn encode(&self, w: &mut Writer<'_>) -> Result<(), Error>

Encode type into diff writer.

Provided Methods§

Source

fn to_unified_string(&self) -> Result<String, Error>

Encode into unified diff string.

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 Encode for DiffContent

Source§

fn encode(&self, w: &mut Writer<'_>) -> Result<(), Error>

Source§

impl Encode for FileDiff

Source§

fn encode(&self, w: &mut Writer<'_>) -> Result<(), Error>

Source§

impl Encode for Modification

Source§

fn encode(&self, w: &mut Writer<'_>) -> Result<(), Error>

Source§

impl Encode for Diff

Source§

fn encode(&self, w: &mut Writer<'_>) -> Result<(), Error>

Source§

impl Encode for Hunk<DiffModification>

Source§

fn encode(&self, w: &mut Writer<'_>) -> Result<(), Error>

Source§

impl Encode for Hunk<Modification>

Source§

fn encode(&self, w: &mut Writer<'_>) -> Result<(), Error>

Implementors§