pub struct HookStore { /* private fields */ }Expand description
In-memory storage for tmux-style hook arrays.
Implementations§
Source§impl HookStore
impl HookStore
Sourcepub fn set(
&mut self,
scope: ScopeSelector,
hook: HookName,
command: String,
lifecycle: HookLifecycle,
) -> Result<u32, RmuxError>
pub fn set( &mut self, scope: ScopeSelector, hook: HookName, command: String, lifecycle: HookLifecycle, ) -> Result<u32, RmuxError>
Registers or replaces a hook using tmux’s default index-zero semantics.
Sourcepub fn set_with_options(
&mut self,
scope: ScopeSelector,
hook: HookName,
command: String,
lifecycle: HookLifecycle,
options: HookSetOptions,
) -> Result<u32, RmuxError>
pub fn set_with_options( &mut self, scope: ScopeSelector, hook: HookName, command: String, lifecycle: HookLifecycle, options: HookSetOptions, ) -> Result<u32, RmuxError>
Registers or mutates a hook using indexed tmux array semantics.
Sourcepub fn unset(
&mut self,
scope: ScopeSelector,
hook: HookName,
index: Option<u32>,
) -> Result<(), RmuxError>
pub fn unset( &mut self, scope: ScopeSelector, hook: HookName, index: Option<u32>, ) -> Result<(), RmuxError>
Removes a hook or a single indexed hook element.
Sourcepub fn global_command(&self, hook: HookName) -> Option<&str>
pub fn global_command(&self, hook: HookName) -> Option<&str>
Returns the first explicit global command for the given hook, when present.
Sourcepub fn global_command_at(&self, hook: HookName, index: u32) -> Option<&str>
pub fn global_command_at(&self, hook: HookName, index: u32) -> Option<&str>
Returns the exact global command at the given array index, when present.
Sourcepub fn global_lifecycle(&self, hook: HookName) -> Option<HookLifecycle>
pub fn global_lifecycle(&self, hook: HookName) -> Option<HookLifecycle>
Returns the first explicit global lifecycle for the given hook, when present.
Sourcepub fn global_lifecycle_at(
&self,
hook: HookName,
index: u32,
) -> Option<HookLifecycle>
pub fn global_lifecycle_at( &self, hook: HookName, index: u32, ) -> Option<HookLifecycle>
Returns the exact global lifecycle at the given array index, when present.
Sourcepub fn session_command(
&self,
session_name: &SessionName,
hook: HookName,
) -> Option<&str>
pub fn session_command( &self, session_name: &SessionName, hook: HookName, ) -> Option<&str>
Returns the first exact session-local command for the given hook, when present.
Sourcepub fn session_command_at(
&self,
session_name: &SessionName,
hook: HookName,
index: u32,
) -> Option<&str>
pub fn session_command_at( &self, session_name: &SessionName, hook: HookName, index: u32, ) -> Option<&str>
Returns the exact session-local command at the given array index, when present.
Sourcepub fn session_lifecycle(
&self,
session_name: &SessionName,
hook: HookName,
) -> Option<HookLifecycle>
pub fn session_lifecycle( &self, session_name: &SessionName, hook: HookName, ) -> Option<HookLifecycle>
Returns the first exact session-local lifecycle for the given hook, when present.
Sourcepub fn session_lifecycle_at(
&self,
session_name: &SessionName,
hook: HookName,
index: u32,
) -> Option<HookLifecycle>
pub fn session_lifecycle_at( &self, session_name: &SessionName, hook: HookName, index: u32, ) -> Option<HookLifecycle>
Returns the exact session-local lifecycle at the given array index, when present.
Sourcepub fn window_command(
&self,
target: &WindowTarget,
hook: HookName,
) -> Option<&str>
pub fn window_command( &self, target: &WindowTarget, hook: HookName, ) -> Option<&str>
Returns the first exact window-local command for the given hook, when present.
Sourcepub fn pane_command(&self, target: &PaneTarget, hook: HookName) -> Option<&str>
pub fn pane_command(&self, target: &PaneTarget, hook: HookName) -> Option<&str>
Returns the first exact pane-local command for the given hook, when present.
Sourcepub fn global_bindings_view(
&self,
root: HookGlobalRoot,
hook: Option<HookName>,
) -> Vec<HookBindingView>
pub fn global_bindings_view( &self, root: HookGlobalRoot, hook: Option<HookName>, ) -> Vec<HookBindingView>
Returns the explicit hook bindings for the requested global root.
Sourcepub fn session_bindings_view(
&self,
session_name: &SessionName,
hook: Option<HookName>,
) -> Vec<HookBindingView>
pub fn session_bindings_view( &self, session_name: &SessionName, hook: Option<HookName>, ) -> Vec<HookBindingView>
Returns the explicit session-local hook bindings.
Sourcepub fn window_bindings_view(
&self,
target: &WindowTarget,
hook: Option<HookName>,
) -> Vec<HookBindingView>
pub fn window_bindings_view( &self, target: &WindowTarget, hook: Option<HookName>, ) -> Vec<HookBindingView>
Returns the explicit window-local hook bindings.
Sourcepub fn pane_bindings_view(
&self,
target: &PaneTarget,
hook: Option<HookName>,
) -> Vec<HookBindingView>
pub fn pane_bindings_view( &self, target: &PaneTarget, hook: Option<HookName>, ) -> Vec<HookBindingView>
Returns the explicit pane-local hook bindings.
Sourcepub fn shipped_global_hooks(
root: HookGlobalRoot,
hook: Option<HookName>,
) -> Vec<HookName>
pub fn shipped_global_hooks( root: HookGlobalRoot, hook: Option<HookName>, ) -> Vec<HookName>
Returns the tmux-compatible hook inventory visible at the requested global root.
Sourcepub fn dispatch(
&mut self,
scope: &ScopeSelector,
hook: HookName,
) -> Vec<HookDispatch>
pub fn dispatch( &mut self, scope: &ScopeSelector, hook: HookName, ) -> Vec<HookDispatch>
Resolves a hook for the provided event scope and returns the matching command batch.
Sourcepub fn remove_session(&mut self, session_name: &SessionName) -> bool
pub fn remove_session(&mut self, session_name: &SessionName) -> bool
Removes all hooks owned by the given session.
Sourcepub fn remove_window(&mut self, target: &WindowTarget) -> bool
pub fn remove_window(&mut self, target: &WindowTarget) -> bool
Removes all hooks owned by the given window and its panes.
Sourcepub fn swap_window_hooks(
&mut self,
source: &WindowTarget,
target: &WindowTarget,
)
pub fn swap_window_hooks( &mut self, source: &WindowTarget, target: &WindowTarget, )
Swaps window and pane hooks between two winlink slots.
Sourcepub fn move_window_hooks(
&mut self,
source: &WindowTarget,
target: &WindowTarget,
)
pub fn move_window_hooks( &mut self, source: &WindowTarget, target: &WindowTarget, )
Moves window and pane hooks from one winlink slot to another.
Sourcepub fn remove_pane(&mut self, target: &PaneTarget) -> bool
pub fn remove_pane(&mut self, target: &PaneTarget) -> bool
Removes all hooks owned by the given pane.
Sourcepub fn remap_session_window_indices(
&mut self,
session_name: &SessionName,
index_map: &BTreeMap<u32, u32>,
) -> Result<(), RmuxError>
pub fn remap_session_window_indices( &mut self, session_name: &SessionName, index_map: &BTreeMap<u32, u32>, ) -> Result<(), RmuxError>
Rekeys window and pane hooks after a session window reindex.
Sourcepub fn rename_session(
&mut self,
session_name: &SessionName,
new_name: SessionName,
) -> Result<(), RmuxError>
pub fn rename_session( &mut self, session_name: &SessionName, new_name: SessionName, ) -> Result<(), RmuxError>
Rekeys all hooks owned by the given session.