pub enum EventData {
None,
Text(String),
Uri(String),
FocusState {
is_focused: bool,
},
Dimensions {
cols: u16,
rows: u16,
},
TitleChange {
old: String,
new: String,
},
UserVar {
name: String,
value: String,
},
Selection {
text: String,
start: (u16, u16),
end: (u16, u16),
},
ExitCode(i32),
Binary(Vec<u8>),
}Expand description
Event-specific data payload
Different events carry different types of data. This enum provides type-safe access to event payloads.
Variants§
None
No data
Text(String)
Plain text data (for output, input, etc.)
Uri(String)
URI/URL data (for OpenUri events)
FocusState
Focus state change
Dimensions
Dimension change (for resize events)
TitleChange
Title change event
UserVar
User variable change (OSC 1337)
Selection
Text selection data
Fields
ExitCode(i32)
Process exit code
Binary(Vec<u8>)
Raw binary data (for legacy hooks)
Implementations§
Source§impl EventData
impl EventData
Sourcepub fn as_focus_state(&self) -> Option<bool>
pub fn as_focus_state(&self) -> Option<bool>
Try to extract focus state
Sourcepub fn as_dimensions(&self) -> Option<(u16, u16)>
pub fn as_dimensions(&self) -> Option<(u16, u16)>
Try to extract dimensions
Sourcepub fn as_title_change(&self) -> Option<(&str, &str)>
pub fn as_title_change(&self) -> Option<(&str, &str)>
Try to extract title change data
Sourcepub fn as_user_var(&self) -> Option<(&str, &str)>
pub fn as_user_var(&self) -> Option<(&str, &str)>
Try to extract user variable data
Sourcepub fn as_selection(&self) -> Option<(&str, (u16, u16), (u16, u16))>
pub fn as_selection(&self) -> Option<(&str, (u16, u16), (u16, u16))>
Try to extract selection data
Sourcepub fn as_exit_code(&self) -> Option<i32>
pub fn as_exit_code(&self) -> Option<i32>
Try to extract exit code
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventData
impl RefUnwindSafe for EventData
impl Send for EventData
impl Sync for EventData
impl Unpin for EventData
impl UnsafeUnpin for EventData
impl UnwindSafe for EventData
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.