Skip to main content

ConsumeBinaryHunkDelegate

Trait ConsumeBinaryHunkDelegate 

Source
pub trait ConsumeBinaryHunkDelegate {
    // Required method
    fn consume_binary_hunk(
        &mut self,
        header: HunkHeader,
        header_str: &str,
        hunk: &[u8],
    ) -> Result<()>;
}
Available on crate feature blob only.
Expand description

A trait for use in conjunction with ConsumeBinaryHunk.

Required Methods§

Source

fn consume_binary_hunk( &mut self, header: HunkHeader, header_str: &str, hunk: &[u8], ) -> Result<()>

Consume a single hunk in unified diff format, along with its header_str that already has a trailing newline added based on the parent ConsumeBinaryHunk configuration, also in unified diff format. The header is the data used to produce header_str.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ConsumeBinaryHunkDelegate for String

An implementation that fails if the input isn’t UTF-8.

Source§

fn consume_binary_hunk( &mut self, _header: HunkHeader, header_str: &str, hunk: &[u8], ) -> Result<()>

Source§

impl ConsumeBinaryHunkDelegate for Vec<u8>

An implementation that writes hunks into a byte buffer.

Source§

fn consume_binary_hunk( &mut self, _header: HunkHeader, header_str: &str, hunk: &[u8], ) -> Result<()>

Source§

impl ConsumeBinaryHunkDelegate for BString

An implementation that writes hunks into a hunman-readable byte buffer.

Source§

fn consume_binary_hunk( &mut self, _header: HunkHeader, header_str: &str, hunk: &[u8], ) -> Result<()>

Implementors§