Struct ::patch::LineEditor

A simple line editor, like sed

Methods

fn new() -> LineEditor

Create a new empty line editor

fn apply(self, text: String) -> String

Apply the line editor to a string

fn add(self, selector: Selector, action: Action) -> Result

Add a new rule to the line editor.

Returns a Result<()>, where the error variant can happen on invalid regexes.

fn add_inverted(self, selector: Selector, action: Action) -> Result

Add a new rule where the selector condition has been inverted to the line editor

Returns a Result<()>, where the error variant can happen on invalid regexes.

Clone the line editor, allowing "forking it" into two different related variants