pub struct WordDiffBuffers { /* private fields */ }Expand description
The per-hunk word-diff renderer state: accumulated minus/plus text.
Implementations§
Source§impl WordDiffBuffers
impl WordDiffBuffers
pub fn new() -> Self
Sourcepub fn push_minus(&mut self, content: &[u8])
pub fn push_minus(&mut self, content: &[u8])
Append one removed line’s content (prefix already stripped).
Sourcepub fn push_plus(&mut self, content: &[u8])
pub fn push_plus(&mut self, content: &[u8])
Append one added line’s content (prefix already stripped).
Sourcepub fn flush(&mut self, out: &mut Vec<u8>, config: &WordDiffConfig<'_>)
pub fn flush(&mut self, out: &mut Vec<u8>, config: &WordDiffConfig<'_>)
Port of diff_words_show: word-diff the accumulated buffers into
out and reset them.
Sourcepub fn emit_context_line(
out: &mut Vec<u8>,
config: &WordDiffConfig<'_>,
content: &[u8],
)
pub fn emit_context_line( out: &mut Vec<u8>, config: &WordDiffConfig<'_>, content: &[u8], )
Emit a context line in word-diff mode (after flushing): porcelain
keeps the prefix and appends ~; plain/color drop the prefix.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WordDiffBuffers
impl RefUnwindSafe for WordDiffBuffers
impl Send for WordDiffBuffers
impl Sync for WordDiffBuffers
impl Unpin for WordDiffBuffers
impl UnsafeUnpin for WordDiffBuffers
impl UnwindSafe for WordDiffBuffers
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more