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§
Provided Methods§
sourcefn try_decode(r: &mut impl BufRead) -> Result<Option<Self>, Error>
fn try_decode(r: &mut impl BufRead) -> Result<Option<Self>, Error>
Decode, and return a None if we reached the end of the stream.
sourcefn from_bytes(bytes: &[u8]) -> Result<Self, Error>
fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Decode from a string input.
Object Safety§
This trait is not object safe.