pub struct TextReplacer { /* private fields */ }Expand description
Text replacer that can perform multiple replacement operations in a single pass over the input text.
Implementations§
Source§impl TextReplacer
impl TextReplacer
Sourcepub fn builder() -> TextReplacerBuilder
pub fn builder() -> TextReplacerBuilder
Creates a new builder for configuring a TextReplacer
Sourcepub fn replace(&self, input: &str) -> String
pub fn replace(&self, input: &str) -> String
Applies all configured replacement operations to the input text
Sourcepub fn replace_file<P: AsRef<Path>>(&self, path: P) -> Result<String>
pub fn replace_file<P: AsRef<Path>>(&self, path: P) -> Result<String>
Reads a file, applies all replacements, and returns the result as a string
Trait Implementations§
Source§impl Clone for TextReplacer
impl Clone for TextReplacer
Source§fn clone(&self) -> TextReplacer
fn clone(&self) -> TextReplacer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TextReplacer
impl RefUnwindSafe for TextReplacer
impl Send for TextReplacer
impl Sync for TextReplacer
impl Unpin for TextReplacer
impl UnsafeUnpin for TextReplacer
impl UnwindSafe for TextReplacer
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