pub enum PanelEvent {
NeedsRedraw,
Quit,
CloseSelf,
Focus(PanelId),
OpenFile {
path: PathBuf,
line: usize,
col: usize,
},
OpenWith {
handler: HandlerId,
path: PathBuf,
},
RunCommand {
command: String,
cwd: Option<PathBuf>,
},
Notify {
level: NotifyLevel,
message: String,
},
}Expand description
The complete vocabulary a panel may emit.
This set is deliberately closed. Editors that let every viewer add its own
variant end up with an enum that each new panel type must edit, turning it
into a chokepoint. New panels register a handler in typ-registry and route
through OpenWith instead.
Variants§
NeedsRedraw
Panel state changed; the app should repaint.
Quit
Quit the application.
CloseSelf
Close the emitting panel.
Focus(PanelId)
Move focus to another panel.
OpenFile
Open a path in whichever panel the registry says owns it.
OpenWith
Open a path with an explicitly chosen handler.
RunCommand
Run a shell command, optionally in a given directory.
Notify
Surface a message to the user.
Trait Implementations§
Source§impl Clone for PanelEvent
impl Clone for PanelEvent
Source§fn clone(&self) -> PanelEvent
fn clone(&self) -> PanelEvent
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 PanelEvent
impl Debug for PanelEvent
impl Eq for PanelEvent
Source§impl PartialEq for PanelEvent
impl PartialEq for PanelEvent
impl StructuralPartialEq for PanelEvent
Auto Trait Implementations§
impl Freeze for PanelEvent
impl RefUnwindSafe for PanelEvent
impl Send for PanelEvent
impl Sync for PanelEvent
impl Unpin for PanelEvent
impl UnsafeUnpin for PanelEvent
impl UnwindSafe for PanelEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more