pub struct Console { /* private fields */ }
Expand description

Used to print messages to the console according to a Verbosity level

Implementations

Create a new console with the given verbosity

Create a new console with default verbosity

Print a message to the console (using standard output)

Print an error message to the console (using standard error)

Print the replacement as two lines (red then green)

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

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.