Struct ruplacer::Replacement[][src]

pub struct Replacement<'a> { /* fields omitted */ }
Expand description

A replacement contains of fragments, the input string and the output string

Implementations

Return the output string

Return the input string

Print the replacement as two lines (red then green)

use ruplacer::{Query, replace};
let input = "let foo_bar = FooBar::new();";
let query = Query::subvert("foo_bar", "spam_eggs");
let replacement = replace(input, &query).unwrap();
replacement.print_self("foo.rs:3");
// outputs:
// foo.rs:3 let foo_bar = FooBar::new()
// foo.rs3 let spam_eggs = SpamEggs::new()

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.