Edit

Trait Edit 

Source
pub trait Edit: Address {
    // Required methods
    fn insert(&mut self, ix: usize, s: &str);
    fn remove(&mut self, from: usize, to: usize);

    // Provided methods
    fn submatch(&self, m: &Match, n: usize) -> Option<String> { ... }
    fn begin_edit_transaction(&mut self) { ... }
    fn end_edit_transaction(&mut self) { ... }
}
Expand description

Something that can be edited by a Program

Required Methods§

Source

fn insert(&mut self, ix: usize, s: &str)

Insert a string at the specified index

Source

fn remove(&mut self, from: usize, to: usize)

Remove all characters from (from..to)

Provided Methods§

Source

fn submatch(&self, m: &Match, n: usize) -> Option<String>

Extract the content of a previous submatch so it can be used in templating

Source

fn begin_edit_transaction(&mut self)

Mark the start of an edit transaction

Source

fn end_edit_transaction(&mut self)

Mark the end of an edit transaction

Implementors§