pub struct EditorOpened {
pub status: ExitStatus,
pub edited_path: EditPathStrategyOut,
}
Expand description
Information about the editor ran.
Fields§
§status: ExitStatus
§edited_path: EditPathStrategyOut
Implementations§
Source§impl EditorOpened
impl EditorOpened
Sourcepub fn status_ok(&self) -> Result<()>
pub fn status_ok(&self) -> Result<()>
Returns an io::Error
if the ExitStatus
of the editor program
wasn’t a success.
Note that the file could still have been successfully edited!
This is just a helper to use with the ?
operator, or whatever.
Sourcepub fn edited_file(&self) -> Result<File>
pub fn edited_file(&self) -> Result<File>
Open the edited file as a read-only File
.
Sourcepub fn edited_path(&self) -> PathBuf
pub fn edited_path(&self) -> PathBuf
The path that was edited.
Sourcepub fn read_to_string(&self) -> Result<String>
pub fn read_to_string(&self) -> Result<String>
Read the edited file to a string.
Auto Trait Implementations§
impl Freeze for EditorOpened
impl RefUnwindSafe for EditorOpened
impl Send for EditorOpened
impl Sync for EditorOpened
impl Unpin for EditorOpened
impl UnwindSafe for EditorOpened
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more