pub struct DiffBuilder { /* private fields */ }Expand description
Writes a C0DIFF 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 records in f.
Sourcepub fn record<F: FnOnce(&mut PatternBuilder<'_>)>(&mut self, f: F) -> &mut Self
pub fn record<F: FnOnce(&mut PatternBuilder<'_>)>(&mut self, f: F) -> &mut Self
RS and one anchored pattern built with a PatternBuilder.
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 record.
Sourcepub fn insert_after(&mut self, anchor: &str, text: &str) -> &mut Self
pub fn insert_after(&mut self, anchor: &str, text: &str) -> &mut Self
Insert text after anchor.
Sourcepub fn delete(
&mut self,
old_text: &str,
context_before: &str,
context_after: &str,
) -> &mut Self
pub fn delete( &mut self, old_text: &str, context_before: &str, context_after: &str, ) -> &mut Self
Remove old_text, found once after the cursor.
Sourcepub fn assert(&mut self, text: &str) -> &mut Self
pub fn assert(&mut self, text: &str) -> &mut Self
Assert that text is present once; nothing changes.
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 Move 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