pub enum HookEffect {
Save {
path: Option<String>,
},
Load {
path: String,
},
Quit {
force: bool,
},
Message(String),
}Expand description
App-level requests a hook cannot fulfil on its own (file I/O, quit).
Hooks push these into crate::HookContext::effects; frontends drain the
queue after each event. This keeps twrite-core headless while letting
hook-only code (vim :w / :q / :e) drive full editor workflows.
Variants§
Save
Save the buffer (None = current path, error if unknown).
Load
Load a file into the buffer, resetting undo history.
Quit
Request application exit.
Message(String)
Show a transient message (status line, prompt error area).
Trait Implementations§
Source§impl Clone for HookEffect
impl Clone for HookEffect
Source§fn clone(&self) -> HookEffect
fn clone(&self) -> HookEffect
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 moreSource§impl Debug for HookEffect
impl Debug for HookEffect
impl Eq for HookEffect
Source§impl PartialEq for HookEffect
impl PartialEq for HookEffect
Source§fn eq(&self, other: &HookEffect) -> bool
fn eq(&self, other: &HookEffect) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for HookEffect
Auto Trait Implementations§
impl Freeze for HookEffect
impl RefUnwindSafe for HookEffect
impl Send for HookEffect
impl Sync for HookEffect
impl Unpin for HookEffect
impl UnsafeUnpin for HookEffect
impl UnwindSafe for HookEffect
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