pub struct OptionStore { /* private fields */ }Expand description
In-memory storage for supported RMUX option values.
Implementations§
Source§impl OptionStore
impl OptionStore
Sourcepub fn global_value(&self, option: OptionName) -> Option<&str>
pub fn global_value(&self, option: OptionName) -> Option<&str>
Returns the exact explicit global value for the given known option.
Sourcepub fn session_value(
&self,
session_name: &SessionName,
option: OptionName,
) -> Option<&str>
pub fn session_value( &self, session_name: &SessionName, option: OptionName, ) -> Option<&str>
Returns the exact session-local value for the given known option.
Sourcepub fn window_value(
&self,
target: &WindowTarget,
option: OptionName,
) -> Option<&str>
pub fn window_value( &self, target: &WindowTarget, option: OptionName, ) -> Option<&str>
Returns the exact window-local value for the given known option.
Sourcepub fn pane_value(
&self,
target: &PaneTarget,
option: OptionName,
) -> Option<&str>
pub fn pane_value( &self, target: &PaneTarget, option: OptionName, ) -> Option<&str>
Returns the exact pane-local value for the given known option.
Sourcepub fn resolve<'a>(
&'a self,
session_name: Option<&'a SessionName>,
option: OptionName,
) -> Option<&'a str>
pub fn resolve<'a>( &'a self, session_name: Option<&'a SessionName>, option: OptionName, ) -> Option<&'a str>
Resolves the effective value using the tmux-style parent chain for the known option.
Sourcepub fn resolve_for_window<'a>(
&'a self,
session_name: &'a SessionName,
window_index: u32,
option: OptionName,
) -> Option<&'a str>
pub fn resolve_for_window<'a>( &'a self, session_name: &'a SessionName, window_index: u32, option: OptionName, ) -> Option<&'a str>
Resolves the effective window value using the tmux-style parent chain.
Sourcepub fn resolve_for_pane<'a>(
&'a self,
session_name: &'a SessionName,
window_index: u32,
pane_index: u32,
option: OptionName,
) -> Option<&'a str>
pub fn resolve_for_pane<'a>( &'a self, session_name: &'a SessionName, window_index: u32, pane_index: u32, option: OptionName, ) -> Option<&'a str>
Resolves the effective pane value using the tmux-style parent chain.
Sourcepub fn resolve_array_values(
&self,
session_name: Option<&SessionName>,
option: OptionName,
) -> Vec<String>
pub fn resolve_array_values( &self, session_name: Option<&SessionName>, option: OptionName, ) -> Vec<String>
Resolves the effective array values for the known option.
Sourcepub fn resolve_name(
&self,
session_name: Option<&SessionName>,
name: &str,
) -> Option<String>
pub fn resolve_name( &self, session_name: Option<&SessionName>, name: &str, ) -> Option<String>
Resolves a string-keyed option in a session context.
Sourcepub fn resolve_name_for_format(
&self,
session_name: Option<&SessionName>,
name: &str,
) -> Option<String>
pub fn resolve_name_for_format( &self, session_name: Option<&SessionName>, name: &str, ) -> Option<String>
Resolves a string-keyed option for tmux format evaluation in a session context.
Sourcepub fn resolve_name_for_window(
&self,
session_name: &SessionName,
window_index: u32,
name: &str,
) -> Option<String>
pub fn resolve_name_for_window( &self, session_name: &SessionName, window_index: u32, name: &str, ) -> Option<String>
Resolves a string-keyed option in a window context.
Sourcepub fn resolve_name_for_window_format(
&self,
session_name: &SessionName,
window_index: u32,
name: &str,
) -> Option<String>
pub fn resolve_name_for_window_format( &self, session_name: &SessionName, window_index: u32, name: &str, ) -> Option<String>
Resolves a string-keyed option for tmux format evaluation in a window context.
Sourcepub fn resolve_name_for_pane(
&self,
session_name: &SessionName,
window_index: u32,
pane_index: u32,
name: &str,
) -> Option<String>
pub fn resolve_name_for_pane( &self, session_name: &SessionName, window_index: u32, pane_index: u32, name: &str, ) -> Option<String>
Resolves a string-keyed option in a pane context.
Sourcepub fn resolve_name_for_pane_format(
&self,
session_name: &SessionName,
window_index: u32,
pane_index: u32,
name: &str,
) -> Option<String>
pub fn resolve_name_for_pane_format( &self, session_name: &SessionName, window_index: u32, pane_index: u32, name: &str, ) -> Option<String>
Resolves a string-keyed option for tmux format evaluation in a pane context.
Sourcepub fn resolved(
&self,
session_name: &SessionName,
) -> HashMap<OptionName, String>
pub fn resolved( &self, session_name: &SessionName, ) -> HashMap<OptionName, String>
Returns the option snapshot that future panes in a session should inherit.
Sourcepub fn resolved_for_pane(
&self,
session_name: &SessionName,
window_index: u32,
pane_index: u32,
) -> HashMap<OptionName, String>
pub fn resolved_for_pane( &self, session_name: &SessionName, window_index: u32, pane_index: u32, ) -> HashMap<OptionName, String>
Returns the option snapshot for a pane after the full inheritance chain is applied.
Sourcepub fn explicit_value_by_name(
&self,
scope: &OptionScopeSelector,
name: &str,
) -> Result<(String, Option<String>), RmuxError>
pub fn explicit_value_by_name( &self, scope: &OptionScopeSelector, name: &str, ) -> Result<(String, Option<String>), RmuxError>
Returns the exact explicit value for a tmux-style option name at a scope.
Sourcepub fn explicit_entries_for_scope(
&self,
scope: &OptionScopeSelector,
) -> Vec<(String, String)>
pub fn explicit_entries_for_scope( &self, scope: &OptionScopeSelector, ) -> Vec<(String, String)>
Returns all explicit option entries stored exactly at a scope.
Source§impl OptionStore
impl OptionStore
Sourcepub fn show_options_lines(
&self,
scope: &OptionScopeSelector,
value_only: bool,
) -> Result<Vec<String>, RmuxError>
pub fn show_options_lines( &self, scope: &OptionScopeSelector, value_only: bool, ) -> Result<Vec<String>, RmuxError>
Returns rendered show-options lines for the selected scope.
Sourcepub fn show_options_lines_filtered(
&self,
scope: &OptionScopeSelector,
name: Option<&str>,
value_only: bool,
) -> Result<Vec<String>, RmuxError>
pub fn show_options_lines_filtered( &self, scope: &OptionScopeSelector, name: Option<&str>, value_only: bool, ) -> Result<Vec<String>, RmuxError>
Returns rendered show-options lines for the selected scope, optionally filtered by name.
Sourcepub fn show_options_lines_with_mode(
&self,
scope: &OptionScopeSelector,
value_only: bool,
mode: ShowOptionsMode,
) -> Result<Vec<String>, RmuxError>
pub fn show_options_lines_with_mode( &self, scope: &OptionScopeSelector, value_only: bool, mode: ShowOptionsMode, ) -> Result<Vec<String>, RmuxError>
Returns rendered show-options lines for the selected scope and mode.
Sourcepub fn show_options_lines_with_mode_filtered(
&self,
scope: &OptionScopeSelector,
name: Option<&str>,
value_only: bool,
mode: ShowOptionsMode,
) -> Result<Vec<String>, RmuxError>
pub fn show_options_lines_with_mode_filtered( &self, scope: &OptionScopeSelector, name: Option<&str>, value_only: bool, mode: ShowOptionsMode, ) -> Result<Vec<String>, RmuxError>
Returns rendered show-options lines for the selected scope, mode, and optional name.
Source§impl OptionStore
impl OptionStore
Sourcepub fn set(
&mut self,
scope: ScopeSelector,
option: OptionName,
value: String,
mode: SetOptionMode,
) -> Result<OptionMutationOutcome, RmuxError>
pub fn set( &mut self, scope: ScopeSelector, option: OptionName, value: String, mode: SetOptionMode, ) -> Result<OptionMutationOutcome, RmuxError>
Applies a mutation for a known legacy option.
Sourcepub fn set_by_name(
&mut self,
scope: OptionScopeSelector,
name: &str,
value: Option<String>,
mode: SetOptionMode,
only_if_unset: bool,
unset: bool,
unset_pane_overrides: bool,
) -> Result<OptionMutationOutcome, RmuxError>
pub fn set_by_name( &mut self, scope: OptionScopeSelector, name: &str, value: Option<String>, mode: SetOptionMode, only_if_unset: bool, unset: bool, unset_pane_overrides: bool, ) -> Result<OptionMutationOutcome, RmuxError>
Applies a mutation using a tmux-style string option name.
Sourcepub fn remove_session(
&mut self,
session_name: &SessionName,
) -> Option<HashMap<OptionName, String>>
pub fn remove_session( &mut self, session_name: &SessionName, ) -> Option<HashMap<OptionName, String>>
Removes all option overrides owned by the given session.
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 option overrides owned by the given session.
Sourcepub fn remove_window(
&mut self,
target: &WindowTarget,
) -> Option<HashMap<OptionName, String>>
pub fn remove_window( &mut self, target: &WindowTarget, ) -> Option<HashMap<OptionName, String>>
Removes all window and pane option overrides owned by the given window.
Sourcepub fn copy_window_overrides(
&mut self,
source: &WindowTarget,
target: &WindowTarget,
)
pub fn copy_window_overrides( &mut self, source: &WindowTarget, target: &WindowTarget, )
Copies exact window and pane overrides from one winlink slot to another.
Sourcepub fn swap_window_overrides(
&mut self,
source: &WindowTarget,
target: &WindowTarget,
)
pub fn swap_window_overrides( &mut self, source: &WindowTarget, target: &WindowTarget, )
Swaps exact window and pane overrides between two winlink slots.
Sourcepub fn move_window_overrides(
&mut self,
source: &WindowTarget,
target: &WindowTarget,
)
pub fn move_window_overrides( &mut self, source: &WindowTarget, target: &WindowTarget, )
Moves exact window and pane overrides from one winlink slot to another.
Sourcepub fn remove_pane(
&mut self,
target: &PaneTarget,
) -> Option<HashMap<OptionName, String>>
pub fn remove_pane( &mut self, target: &PaneTarget, ) -> Option<HashMap<OptionName, String>>
Removes all pane option overrides owned by the given pane.
Sourcepub fn copy_pane_overrides(&mut self, source: &PaneTarget, target: &PaneTarget)
pub fn copy_pane_overrides(&mut self, source: &PaneTarget, target: &PaneTarget)
Copies exact pane-local overrides between two aliases of one pane.
Sourcepub fn remap_pane_indices(
&mut self,
session_name: &SessionName,
window_index: u32,
index_map: &BTreeMap<u32, u32>,
) -> Result<(), RmuxError>
pub fn remap_pane_indices( &mut self, session_name: &SessionName, window_index: u32, index_map: &BTreeMap<u32, u32>, ) -> Result<(), RmuxError>
Rekeys pane-local overrides after pane indices change within one window.
Sourcepub fn transfer_pane_overrides(
&mut self,
source: &PaneTarget,
target: &PaneTarget,
)
pub fn transfer_pane_overrides( &mut self, source: &PaneTarget, target: &PaneTarget, )
Moves exact pane-local overrides from one pane slot to another.
Sourcepub fn swap_pane_overrides(&mut self, source: &PaneTarget, target: &PaneTarget)
pub fn swap_pane_overrides(&mut self, source: &PaneTarget, target: &PaneTarget)
Swaps exact pane-local overrides between two pane slots.
Sourcepub fn rekey_pane_overrides(
&mut self,
mappings: &[(PaneTarget, Option<PaneTarget>)],
) -> Result<(), RmuxError>
pub fn rekey_pane_overrides( &mut self, mappings: &[(PaneTarget, Option<PaneTarget>)], ) -> Result<(), RmuxError>
Atomically rekeys or removes exact pane-local overrides.
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 option overrides after a session window reindex.
Trait Implementations§
Source§impl Clone for OptionStore
impl Clone for OptionStore
Source§fn clone(&self) -> OptionStore
fn clone(&self) -> OptionStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more