pub struct DiffBuilder { /* private fields */ }Expand description
Writes a C0-DIFF document.
Implementations§
Source§impl DiffBuilder
impl DiffBuilder
Sourcepub fn file<F: FnOnce(&mut DiffBuilder)>(
&mut self,
path: &str,
f: F,
) -> &mut Self
pub fn file<F: FnOnce(&mut DiffBuilder)>( &mut self, path: &str, f: F, ) -> &mut Self
FS and a path, then the file’s lines in f.
Sourcepub fn section<F: FnOnce(&mut SectionBuilder<'_>)>(&mut self, f: F) -> &mut Self
pub fn section<F: FnOnce(&mut SectionBuilder<'_>)>(&mut self, f: F) -> &mut Self
GS and a pattern built with a SectionBuilder.
Sourcepub fn replace(
&mut self,
context_before: &str,
old_text: &str,
new_text: &str,
context_after: &str,
) -> &mut Self
pub fn replace( &mut self, context_before: &str, old_text: &str, new_text: &str, context_after: &str, ) -> &mut Self
Anchor, old → new, anchor in one section.
Sourcepub fn replace_all(&mut self, old_text: &str, new_text: &str) -> &mut Self
pub fn replace_all(&mut self, old_text: &str, new_text: &str) -> &mut Self
RS old SUB new: every occurrence within the current section’s
scope. The old part must not be empty.
pub fn eot(&mut self) -> &mut Self
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl Forget for DiffBuilder
impl Freeze for DiffBuilder
impl RefUnwindSafe for DiffBuilder
impl Send for DiffBuilder
impl Sync for DiffBuilder
impl Unpin for DiffBuilder
impl UnsafeUnpin for DiffBuilder
impl UnwindSafe for DiffBuilder
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