Edit

Trait Edit 

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

    // Provided methods
    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 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Edit for Buffer

Source§

impl Edit for GapBuffer

Source§

impl<R> Edit for CachingStream<R>
where R: Read,