Trait radicle_cli::git::unified_diff::Decode

source ·
pub trait Decode: Sized {
    // Required method
    fn decode(r: &mut impl BufRead) -> Result<Self, Error>;

    // Provided methods
    fn try_decode(r: &mut impl BufRead) -> Result<Option<Self>, Error> { ... }
    fn parse(s: &str) -> Result<Self, Error> { ... }
    fn from_bytes(bytes: &[u8]) -> Result<Self, Error> { ... }
}
Expand description

Diff-related types that can be decoded from the unified diff format.

Required Methods§

source

fn decode(r: &mut impl BufRead) -> Result<Self, Error>

Decode, and fail if we reach the end of the stream.

Provided Methods§

source

fn try_decode(r: &mut impl BufRead) -> Result<Option<Self>, Error>

Decode, and return a None if we reached the end of the stream.

source

fn parse(s: &str) -> Result<Self, Error>

Decode from a string input.

source

fn from_bytes(bytes: &[u8]) -> Result<Self, Error>

Decode from a string input.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Decode for DiffContent

source§

fn decode(r: &mut impl BufRead) -> Result<Self, Error>

source§

impl Decode for Modification

source§

fn decode(r: &mut impl BufRead) -> Result<Self, Error>

source§

impl Decode for Diff

source§

fn decode(r: &mut impl BufRead) -> Result<Self, Error>

Decode from git’s unified diff format, consuming the entire input.

source§

impl Decode for Hunk<DiffModification>

source§

fn decode(r: &mut impl BufRead) -> Result<Self, Error>

source§

impl Decode for Hunk<Modification>

source§

fn decode(r: &mut impl BufRead) -> Result<Self, Error>

Implementors§