#[non_exhaustive]pub enum EditorSource {
Override(String),
EnvLookup,
}Expand description
Where the editor command comes from.
§Examples
use rusty_vipe::EditorSource;
// Use an explicit editor command (whitespace-aware splitting).
let _ = EditorSource::Override(String::from("code --wait"));
// Or follow the standard env precedence ladder.
let _ = EditorSource::EnvLookup;Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Override(String)
Explicit override (--editor=<cmd> flag, Default mode only). Carries
the raw command string; whitespace-aware splitting happens at run time.
EnvLookup
Follow the precedence-laddered env lookup: $VISUAL > $EDITOR >
/usr/bin/editor (Unix) > vi (Unix) / notepad.exe (Windows).
Trait Implementations§
Source§impl Clone for EditorSource
impl Clone for EditorSource
Source§fn clone(&self) -> EditorSource
fn clone(&self) -> EditorSource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EditorSource
impl RefUnwindSafe for EditorSource
impl Send for EditorSource
impl Sync for EditorSource
impl Unpin for EditorSource
impl UnsafeUnpin for EditorSource
impl UnwindSafe for EditorSource
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