Skip to main content

OptionStore

Struct OptionStore 

Source
pub struct OptionStore { /* private fields */ }
Expand description

In-memory storage for supported RMUX option values.

Implementations§

Source§

impl OptionStore

Source

pub fn global_value(&self, option: OptionName) -> Option<&str>

Returns the exact explicit global value for the given known option.

Source

pub fn session_value( &self, session_name: &SessionName, option: OptionName, ) -> Option<&str>

Returns the exact session-local value for the given known option.

Source

pub fn window_value( &self, target: &WindowTarget, option: OptionName, ) -> Option<&str>

Returns the exact window-local value for the given known option.

Source

pub fn pane_value( &self, target: &PaneTarget, option: OptionName, ) -> Option<&str>

Returns the exact pane-local value for the given known option.

Source

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.

Source

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.

Source

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.

Source

pub fn resolve_array_values( &self, session_name: Option<&SessionName>, option: OptionName, ) -> Vec<String>

Resolves the effective array values for the known option.

Source

pub fn resolve_name( &self, session_name: Option<&SessionName>, name: &str, ) -> Option<String>

Resolves a string-keyed option in a session context.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn resolved( &self, session_name: &SessionName, ) -> HashMap<OptionName, String>

Returns the option snapshot that future panes in a session should inherit.

Source

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.

Source

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.

Source

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

Source

pub fn show_options_lines( &self, scope: &OptionScopeSelector, value_only: bool, ) -> Result<Vec<String>, RmuxError>

Returns rendered show-options lines for the selected scope.

Source

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.

Source

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.

Source

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

Source

pub fn new() -> Self

Creates an empty option store with no explicit overrides.

Source

pub fn is_empty(&self) -> bool

Returns whether no explicit option overrides are present.

Source

pub fn set( &mut self, scope: ScopeSelector, option: OptionName, value: String, mode: SetOptionMode, ) -> Result<OptionMutationOutcome, RmuxError>

Applies a mutation for a known legacy option.

Source

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.

Source

pub fn remove_session( &mut self, session_name: &SessionName, ) -> Option<HashMap<OptionName, String>>

Removes all option overrides owned by the given session.

Source

pub fn rename_session( &mut self, session_name: &SessionName, new_name: SessionName, ) -> Result<(), RmuxError>

Rekeys all option overrides owned by the given session.

Source

pub fn remove_window( &mut self, target: &WindowTarget, ) -> Option<HashMap<OptionName, String>>

Removes all window and pane option overrides owned by the given window.

Source

pub fn copy_window_overrides( &mut self, source: &WindowTarget, target: &WindowTarget, )

Copies exact window and pane overrides from one winlink slot to another.

Source

pub fn swap_window_overrides( &mut self, source: &WindowTarget, target: &WindowTarget, )

Swaps exact window and pane overrides between two winlink slots.

Source

pub fn move_window_overrides( &mut self, source: &WindowTarget, target: &WindowTarget, )

Moves exact window and pane overrides from one winlink slot to another.

Source

pub fn remove_pane( &mut self, target: &PaneTarget, ) -> Option<HashMap<OptionName, String>>

Removes all pane option overrides owned by the given pane.

Source

pub fn copy_pane_overrides(&mut self, source: &PaneTarget, target: &PaneTarget)

Copies exact pane-local overrides between two aliases of one pane.

Source

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.

Source

pub fn transfer_pane_overrides( &mut self, source: &PaneTarget, target: &PaneTarget, )

Moves exact pane-local overrides from one pane slot to another.

Source

pub fn swap_pane_overrides(&mut self, source: &PaneTarget, target: &PaneTarget)

Swaps exact pane-local overrides between two pane slots.

Source

pub fn rekey_pane_overrides( &mut self, mappings: &[(PaneTarget, Option<PaneTarget>)], ) -> Result<(), RmuxError>

Atomically rekeys or removes exact pane-local overrides.

Source

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

Source§

fn clone(&self) -> OptionStore

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OptionStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OptionStore

Source§

fn default() -> OptionStore

Returns the “default value” for a type. Read more
Source§

impl Eq for OptionStore

Source§

impl PartialEq for OptionStore

Source§

fn eq(&self, other: &OptionStore) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OptionStore

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.