Struct clt::Editor
[−]
[src]
pub struct Editor<'a, 'k, 'v> { /* fields omitted */ }
One editor for you to edit the given text or file.
Methods
impl<'a, 'k, 'v> Editor<'a, 'k, 'v>
[src]
fn new(editor: &'a str) -> Editor
Create one new editor.
fn env(&mut self, key: &'k str, value: &'v str)
Inserts or updates an environment variable mapping.
fn edit_file(&self, filename: &str)
Edit a file. Examples:
use clt::Editor; let editor = Editor::new("vim"); editor.edit_file("/path/to/myfile.py");
fn edit(&self, text: String, extension: &str) -> String
Edit some text. Examples:
use clt::Editor; let editor = Editor::new("vim"); let mut text = String::new(); text.push_str("hello"); let edited = editor.edit(text, ".txt");