pub struct Editor { /* private fields */ }
Expand description

Launches the default editor to edit a string.

Example

use dialoguer::Editor;

if let Some(rv) = Editor::new().edit("Enter a commit message").unwrap() {
    println!("Your message:");
    println!("{}", rv);
} else {
    println!("Abort!");
}

Implementations

Creates a new editor.

Sets a specific editor executable.

Sets a specific extension

Enables or disables the save requirement.

Enables or disables trailing newline stripping.

This is on by default.

Launches the editor to edit a string.

Returns None if the file was not saved or otherwise the entered text.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.