pub struct Connection { /* private fields */ }Expand description
A blocking connection to the RMUX server that exchanges typed frames.
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn set_buffer(
&mut self,
name: Option<String>,
content: Vec<u8>,
append: bool,
new_name: Option<String>,
set_clipboard: bool,
) -> Result<Response, ClientError>
pub fn set_buffer( &mut self, name: Option<String>, content: Vec<u8>, append: bool, new_name: Option<String>, set_clipboard: bool, ) -> Result<Response, ClientError>
Sends a set-buffer request over the detached RPC channel.
Sourcepub fn show_buffer(
&mut self,
name: Option<String>,
) -> Result<Response, ClientError>
pub fn show_buffer( &mut self, name: Option<String>, ) -> Result<Response, ClientError>
Sends a show-buffer request over the detached RPC channel.
Sourcepub fn paste_buffer(
&mut self,
name: Option<String>,
target: PaneTarget,
delete_after: bool,
separator: Option<String>,
linefeed: bool,
raw: bool,
bracketed: bool,
) -> Result<Response, ClientError>
pub fn paste_buffer( &mut self, name: Option<String>, target: PaneTarget, delete_after: bool, separator: Option<String>, linefeed: bool, raw: bool, bracketed: bool, ) -> Result<Response, ClientError>
Sends a paste-buffer request over the detached RPC channel.
Sourcepub fn list_buffers(
&mut self,
format: Option<String>,
filter: Option<String>,
sort_order: Option<String>,
reversed: bool,
) -> Result<Response, ClientError>
pub fn list_buffers( &mut self, format: Option<String>, filter: Option<String>, sort_order: Option<String>, reversed: bool, ) -> Result<Response, ClientError>
Sends a list-buffers request over the detached RPC channel.
Sourcepub fn delete_buffer(
&mut self,
name: Option<String>,
) -> Result<Response, ClientError>
pub fn delete_buffer( &mut self, name: Option<String>, ) -> Result<Response, ClientError>
Sends a delete-buffer request over the detached RPC channel.
Sourcepub fn load_buffer(
&mut self,
path: String,
name: Option<String>,
set_clipboard: bool,
) -> Result<Response, ClientError>
pub fn load_buffer( &mut self, path: String, name: Option<String>, set_clipboard: bool, ) -> Result<Response, ClientError>
Sends a load-buffer request over the detached RPC channel.
Sourcepub fn save_buffer(
&mut self,
path: String,
name: Option<String>,
append: bool,
) -> Result<Response, ClientError>
pub fn save_buffer( &mut self, path: String, name: Option<String>, append: bool, ) -> Result<Response, ClientError>
Sends a save-buffer request over the detached RPC channel.
Sourcepub fn capture_pane(
&mut self,
request: CapturePaneRequest,
) -> Result<Response, ClientError>
pub fn capture_pane( &mut self, request: CapturePaneRequest, ) -> Result<Response, ClientError>
Sends a capture-pane request over the detached RPC channel.
Sourcepub fn clear_history(
&mut self,
target: PaneTarget,
reset_hyperlinks: bool,
) -> Result<Response, ClientError>
pub fn clear_history( &mut self, target: PaneTarget, reset_hyperlinks: bool, ) -> Result<Response, ClientError>
Sends a clear-history request over the detached RPC channel.
Source§impl Connection
impl Connection
Sourcepub fn set_option(
&mut self,
scope: ScopeSelector,
option: OptionName,
value: String,
mode: SetOptionMode,
) -> Result<Response, ClientError>
pub fn set_option( &mut self, scope: ScopeSelector, option: OptionName, value: String, mode: SetOptionMode, ) -> Result<Response, ClientError>
Sends a set-option request over the detached RPC channel.
Sourcepub fn set_option_by_name(
&mut self,
scope: OptionScopeSelector,
name: String,
value: Option<String>,
mode: SetOptionMode,
only_if_unset: bool,
unset: bool,
unset_pane_overrides: bool,
) -> Result<Response, ClientError>
pub fn set_option_by_name( &mut self, scope: OptionScopeSelector, name: String, value: Option<String>, mode: SetOptionMode, only_if_unset: bool, unset: bool, unset_pane_overrides: bool, ) -> Result<Response, ClientError>
Sends a string-keyed set-option request over the detached RPC channel.
Sourcepub fn set_environment(
&mut self,
scope: ScopeSelector,
name: String,
value: String,
mode: Option<SetEnvironmentMode>,
hidden: bool,
format: bool,
) -> Result<Response, ClientError>
pub fn set_environment( &mut self, scope: ScopeSelector, name: String, value: String, mode: Option<SetEnvironmentMode>, hidden: bool, format: bool, ) -> Result<Response, ClientError>
Sends a set-environment request over the detached RPC channel.
Sourcepub fn set_hook(
&mut self,
scope: ScopeSelector,
hook: HookName,
command: String,
lifecycle: HookLifecycle,
) -> Result<Response, ClientError>
pub fn set_hook( &mut self, scope: ScopeSelector, hook: HookName, command: String, lifecycle: HookLifecycle, ) -> Result<Response, ClientError>
Sends a set-hook request over the detached RPC channel.
Sourcepub fn set_hook_mutation(
&mut self,
scope: ScopeSelector,
hook: HookName,
command: Option<String>,
lifecycle: HookLifecycle,
append: bool,
unset: bool,
run_immediately: bool,
index: Option<u32>,
) -> Result<Response, ClientError>
pub fn set_hook_mutation( &mut self, scope: ScopeSelector, hook: HookName, command: Option<String>, lifecycle: HookLifecycle, append: bool, unset: bool, run_immediately: bool, index: Option<u32>, ) -> Result<Response, ClientError>
Sends an extended set-hook mutation over the detached RPC channel.
Sourcepub fn show_options(
&mut self,
scope: OptionScopeSelector,
name: Option<String>,
value_only: bool,
include_inherited: bool,
) -> Result<Response, ClientError>
pub fn show_options( &mut self, scope: OptionScopeSelector, name: Option<String>, value_only: bool, include_inherited: bool, ) -> Result<Response, ClientError>
Sends a show-options request over the detached RPC channel.
Sourcepub fn show_environment(
&mut self,
scope: ScopeSelector,
name: Option<String>,
hidden: bool,
shell_format: bool,
) -> Result<Response, ClientError>
pub fn show_environment( &mut self, scope: ScopeSelector, name: Option<String>, hidden: bool, shell_format: bool, ) -> Result<Response, ClientError>
Sends a show-environment request over the detached RPC channel.
Sourcepub fn show_hooks(
&mut self,
scope: ScopeSelector,
window: bool,
pane: bool,
hook: Option<HookName>,
) -> Result<Response, ClientError>
pub fn show_hooks( &mut self, scope: ScopeSelector, window: bool, pane: bool, hook: Option<HookName>, ) -> Result<Response, ClientError>
Sends a show-hooks request over the detached RPC channel.
Sourcepub fn source_file(
&mut self,
paths: Vec<String>,
quiet: bool,
parse_only: bool,
verbose: bool,
expand_paths: bool,
target: Option<PaneTarget>,
stdin: Option<String>,
) -> Result<Response, ClientError>
pub fn source_file( &mut self, paths: Vec<String>, quiet: bool, parse_only: bool, verbose: bool, expand_paths: bool, target: Option<PaneTarget>, stdin: Option<String>, ) -> Result<Response, ClientError>
Sends a source-file request over the detached RPC channel.
Source§impl Connection
impl Connection
Sourcepub fn bind_key(
&mut self,
request: BindKeyRequest,
) -> Result<Response, ClientError>
pub fn bind_key( &mut self, request: BindKeyRequest, ) -> Result<Response, ClientError>
Sends a bind-key request over the detached RPC channel.
Sourcepub fn unbind_key(
&mut self,
request: UnbindKeyRequest,
) -> Result<Response, ClientError>
pub fn unbind_key( &mut self, request: UnbindKeyRequest, ) -> Result<Response, ClientError>
Sends an unbind-key request over the detached RPC channel.
Sourcepub fn list_keys(
&mut self,
request: ListKeysRequest,
) -> Result<Response, ClientError>
pub fn list_keys( &mut self, request: ListKeysRequest, ) -> Result<Response, ClientError>
Sends a list-keys request over the detached RPC channel.
Source§impl Connection
impl Connection
Sourcepub fn swap_pane(
&mut self,
source: PaneTarget,
target: PaneTarget,
detached: bool,
preserve_zoom: bool,
) -> Result<Response, ClientError>
pub fn swap_pane( &mut self, source: PaneTarget, target: PaneTarget, detached: bool, preserve_zoom: bool, ) -> Result<Response, ClientError>
Sends a swap-pane request over the detached RPC channel.
Sourcepub fn swap_pane_with_next(
&mut self,
target: PaneTarget,
detached: bool,
preserve_zoom: bool,
) -> Result<Response, ClientError>
pub fn swap_pane_with_next( &mut self, target: PaneTarget, detached: bool, preserve_zoom: bool, ) -> Result<Response, ClientError>
Sends swap-pane -D over the detached RPC channel.
Sourcepub fn swap_pane_with_previous(
&mut self,
target: PaneTarget,
detached: bool,
preserve_zoom: bool,
) -> Result<Response, ClientError>
pub fn swap_pane_with_previous( &mut self, target: PaneTarget, detached: bool, preserve_zoom: bool, ) -> Result<Response, ClientError>
Sends swap-pane -U over the detached RPC channel.
Sourcepub fn last_pane(
&mut self,
target: WindowTarget,
) -> Result<Response, ClientError>
pub fn last_pane( &mut self, target: WindowTarget, ) -> Result<Response, ClientError>
Sends a last-pane request over the detached RPC channel.
Sourcepub fn join_pane(
&mut self,
request: JoinPaneRequest,
) -> Result<Response, ClientError>
pub fn join_pane( &mut self, request: JoinPaneRequest, ) -> Result<Response, ClientError>
Sends a join-pane request over the detached RPC channel.
Sourcepub fn move_pane(
&mut self,
request: MovePaneRequest,
) -> Result<Response, ClientError>
pub fn move_pane( &mut self, request: MovePaneRequest, ) -> Result<Response, ClientError>
Sends a move-pane request over the detached RPC channel.
Sourcepub fn break_pane(
&mut self,
request: BreakPaneRequest,
) -> Result<Response, ClientError>
pub fn break_pane( &mut self, request: BreakPaneRequest, ) -> Result<Response, ClientError>
Sends a break-pane request over the detached RPC channel.
Sourcepub fn resize_pane(
&mut self,
target: PaneTarget,
adjustment: ResizePaneAdjustment,
) -> Result<Response, ClientError>
pub fn resize_pane( &mut self, target: PaneTarget, adjustment: ResizePaneAdjustment, ) -> Result<Response, ClientError>
Sends a resize-pane request over the detached RPC channel.
Sourcepub fn display_panes(
&mut self,
target: SessionName,
duration_ms: Option<u64>,
non_blocking: bool,
no_command: bool,
template: Option<String>,
) -> Result<Response, ClientError>
pub fn display_panes( &mut self, target: SessionName, duration_ms: Option<u64>, non_blocking: bool, no_command: bool, template: Option<String>, ) -> Result<Response, ClientError>
Sends a display-panes request over the detached RPC channel.
Sourcepub fn pipe_pane(
&mut self,
target: PaneTarget,
stdin: bool,
stdout: bool,
once: bool,
command: Option<String>,
) -> Result<Response, ClientError>
pub fn pipe_pane( &mut self, target: PaneTarget, stdin: bool, stdout: bool, once: bool, command: Option<String>, ) -> Result<Response, ClientError>
Sends a pipe-pane request over the detached RPC channel.
Sourcepub fn respawn_pane(
&mut self,
request: RespawnPaneRequest,
) -> Result<Response, ClientError>
pub fn respawn_pane( &mut self, request: RespawnPaneRequest, ) -> Result<Response, ClientError>
Sends a respawn-pane request over the detached RPC channel.
Sourcepub fn select_pane(
&mut self,
target: PaneTarget,
) -> Result<Response, ClientError>
pub fn select_pane( &mut self, target: PaneTarget, ) -> Result<Response, ClientError>
Sends a select-pane request over the detached RPC channel.
Sourcepub fn select_pane_with_title(
&mut self,
target: PaneTarget,
title: Option<String>,
) -> Result<Response, ClientError>
pub fn select_pane_with_title( &mut self, target: PaneTarget, title: Option<String>, ) -> Result<Response, ClientError>
Sends a select-pane request with an optional title over the detached RPC channel.
Sourcepub fn select_pane_adjacent(
&mut self,
target: PaneTarget,
direction: SelectPaneDirection,
) -> Result<Response, ClientError>
pub fn select_pane_adjacent( &mut self, target: PaneTarget, direction: SelectPaneDirection, ) -> Result<Response, ClientError>
Sends a directional select-pane request over the detached RPC channel.
Sourcepub fn select_pane_mark(
&mut self,
target: PaneTarget,
clear: bool,
) -> Result<Response, ClientError>
pub fn select_pane_mark( &mut self, target: PaneTarget, clear: bool, ) -> Result<Response, ClientError>
Sends select-pane -m or select-pane -M over the detached RPC channel.
Sourcepub fn select_pane_mark_with_title(
&mut self,
target: PaneTarget,
clear: bool,
title: Option<String>,
) -> Result<Response, ClientError>
pub fn select_pane_mark_with_title( &mut self, target: PaneTarget, clear: bool, title: Option<String>, ) -> Result<Response, ClientError>
Sends select-pane -m/-M with an optional title over the detached RPC channel.
Sourcepub fn kill_pane(&mut self, target: PaneTarget) -> Result<Response, ClientError>
pub fn kill_pane(&mut self, target: PaneTarget) -> Result<Response, ClientError>
Sends a kill-pane request over the detached RPC channel.
Sourcepub fn kill_pane_with_options(
&mut self,
target: PaneTarget,
kill_all_except: bool,
) -> Result<Response, ClientError>
pub fn kill_pane_with_options( &mut self, target: PaneTarget, kill_all_except: bool, ) -> Result<Response, ClientError>
Sends a kill-pane request with extended tmux flags.
Sourcepub fn send_keys(
&mut self,
target: PaneTarget,
keys: Vec<String>,
) -> Result<Response, ClientError>
pub fn send_keys( &mut self, target: PaneTarget, keys: Vec<String>, ) -> Result<Response, ClientError>
Sends a send-keys request over the detached RPC channel.
Sourcepub fn send_keys_extended(
&mut self,
request: SendKeysExtRequest,
) -> Result<Response, ClientError>
pub fn send_keys_extended( &mut self, request: SendKeysExtRequest, ) -> Result<Response, ClientError>
Sends an extended send-keys request over the detached RPC channel.
Sourcepub fn send_prefix(
&mut self,
target: Option<PaneTarget>,
secondary: bool,
) -> Result<Response, ClientError>
pub fn send_prefix( &mut self, target: Option<PaneTarget>, secondary: bool, ) -> Result<Response, ClientError>
Sends a send-prefix request over the detached RPC channel.
Sourcepub fn copy_mode(
&mut self,
request: CopyModeRequest,
) -> Result<Response, ClientError>
pub fn copy_mode( &mut self, request: CopyModeRequest, ) -> Result<Response, ClientError>
Sends a copy-mode request over the detached RPC channel.
Sourcepub fn clock_mode(
&mut self,
target: Option<PaneTarget>,
) -> Result<Response, ClientError>
pub fn clock_mode( &mut self, target: Option<PaneTarget>, ) -> Result<Response, ClientError>
Sends a clock-mode request over the detached RPC channel.
Source§impl Connection
impl Connection
Sourcepub fn run_shell(
&mut self,
command: String,
background: bool,
as_commands: bool,
show_stderr: bool,
delay_seconds: Option<f64>,
start_directory: Option<PathBuf>,
target: Option<PaneTarget>,
) -> Result<Response, ClientError>
pub fn run_shell( &mut self, command: String, background: bool, as_commands: bool, show_stderr: bool, delay_seconds: Option<f64>, start_directory: Option<PathBuf>, target: Option<PaneTarget>, ) -> Result<Response, ClientError>
Sends a run-shell request over the detached RPC channel without a
response read timeout.
Sourcepub fn if_shell(
&mut self,
condition: String,
format_mode: bool,
then_command: String,
else_command: Option<String>,
target: Option<Target>,
background: bool,
) -> Result<Response, ClientError>
pub fn if_shell( &mut self, condition: String, format_mode: bool, then_command: String, else_command: Option<String>, target: Option<Target>, background: bool, ) -> Result<Response, ClientError>
Sends an if-shell request over the detached RPC channel without a
response read timeout.
Sourcepub fn wait_for(
&mut self,
channel: String,
mode: WaitForMode,
) -> Result<Response, ClientError>
pub fn wait_for( &mut self, channel: String, mode: WaitForMode, ) -> Result<Response, ClientError>
Sends a wait-for request over the detached RPC channel without a
response read timeout.
Source§impl Connection
impl Connection
Sourcepub fn start_server(
socket_path: &Path,
no_start_server: bool,
config: AutoStartConfig,
) -> Result<Self, StartServerError>
pub fn start_server( socket_path: &Path, no_start_server: bool, config: AutoStartConfig, ) -> Result<Self, StartServerError>
Ensures the server is available, honouring top-level no-start-server behavior.
Sourcepub fn kill_server(&mut self) -> Result<Response, ClientError>
pub fn kill_server(&mut self) -> Result<Response, ClientError>
Sends a kill-server request over the detached RPC channel.
Sourcepub fn daemon_status(&mut self) -> Result<Response, ClientError>
pub fn daemon_status(&mut self) -> Result<Response, ClientError>
Sends an internal daemon status request over the detached RPC channel.
Sourcepub fn shutdown_if_idle(&mut self) -> Result<Response, ClientError>
pub fn shutdown_if_idle(&mut self) -> Result<Response, ClientError>
Sends an internal idle-only daemon shutdown request.
Sourcepub fn lock_server(&mut self) -> Result<Response, ClientError>
pub fn lock_server(&mut self) -> Result<Response, ClientError>
Sends a lock-server request over the detached RPC channel.
Sourcepub fn lock_session(
&mut self,
target: SessionName,
) -> Result<Response, ClientError>
pub fn lock_session( &mut self, target: SessionName, ) -> Result<Response, ClientError>
Sends a lock-session request over the detached RPC channel.
Sourcepub fn lock_client(
&mut self,
target_client: String,
) -> Result<Response, ClientError>
pub fn lock_client( &mut self, target_client: String, ) -> Result<Response, ClientError>
Sends a lock-client request over the detached RPC channel.
Sourcepub fn server_access(
&mut self,
request: ServerAccessRequest,
) -> Result<Response, ClientError>
pub fn server_access( &mut self, request: ServerAccessRequest, ) -> Result<Response, ClientError>
Sends a server-access request over the detached RPC channel.
Source§impl Connection
impl Connection
Sourcepub fn new_session(
&mut self,
session_name: SessionName,
detached: bool,
size: Option<TerminalSize>,
) -> Result<Response, ClientError>
pub fn new_session( &mut self, session_name: SessionName, detached: bool, size: Option<TerminalSize>, ) -> Result<Response, ClientError>
Sends a new-session request over the detached RPC channel.
Sourcepub fn new_session_with_environment(
&mut self,
session_name: SessionName,
detached: bool,
size: Option<TerminalSize>,
environment: Option<Vec<String>>,
) -> Result<Response, ClientError>
pub fn new_session_with_environment( &mut self, session_name: SessionName, detached: bool, size: Option<TerminalSize>, environment: Option<Vec<String>>, ) -> Result<Response, ClientError>
Sends a new-session request with explicit spawn environment overrides.
Sourcepub fn new_session_extended(
&mut self,
request: NewSessionExtRequest,
) -> Result<Response, ClientError>
pub fn new_session_extended( &mut self, request: NewSessionExtRequest, ) -> Result<Response, ClientError>
Sends an extended new-session request with grouped-session and attach-if-exists semantics.
Sourcepub fn has_session(
&mut self,
target: SessionName,
) -> Result<Response, ClientError>
pub fn has_session( &mut self, target: SessionName, ) -> Result<Response, ClientError>
Sends a has-session request over the detached RPC channel.
Sourcepub fn kill_session(
&mut self,
request: KillSessionRequest,
) -> Result<Response, ClientError>
pub fn kill_session( &mut self, request: KillSessionRequest, ) -> Result<Response, ClientError>
Sends a kill-session request over the detached RPC channel.
Sourcepub fn rename_session(
&mut self,
target: SessionName,
new_name: SessionName,
) -> Result<Response, ClientError>
pub fn rename_session( &mut self, target: SessionName, new_name: SessionName, ) -> Result<Response, ClientError>
Sends a rename-session request over the detached RPC channel.
Sourcepub fn list_sessions(
&mut self,
request: ListSessionsRequest,
) -> Result<Response, ClientError>
pub fn list_sessions( &mut self, request: ListSessionsRequest, ) -> Result<Response, ClientError>
Sends a list-sessions request over the detached RPC channel.
Sourcepub fn list_panes(
&mut self,
target: SessionName,
format: Option<String>,
) -> Result<Response, ClientError>
pub fn list_panes( &mut self, target: SessionName, format: Option<String>, ) -> Result<Response, ClientError>
Sends a list-panes request over the detached RPC channel.
Sourcepub fn list_panes_in_window(
&mut self,
target: SessionName,
target_window_index: Option<u32>,
format: Option<String>,
) -> Result<Response, ClientError>
pub fn list_panes_in_window( &mut self, target: SessionName, target_window_index: Option<u32>, format: Option<String>, ) -> Result<Response, ClientError>
Sends a list-panes request scoped to an optional window index.
Sourcepub fn switch_client(
&mut self,
target: SessionName,
) -> Result<Response, ClientError>
pub fn switch_client( &mut self, target: SessionName, ) -> Result<Response, ClientError>
Sends a switch-client request over the detached RPC channel.
Sourcepub fn switch_client_extended(
&mut self,
target: Option<SessionName>,
key_table: Option<String>,
) -> Result<Response, ClientError>
pub fn switch_client_extended( &mut self, target: Option<SessionName>, key_table: Option<String>, ) -> Result<Response, ClientError>
Sends an extended switch-client request over the detached RPC channel.
Sourcepub fn switch_client_with_session_flags(
&mut self,
request: SwitchClientExt2Request,
) -> Result<Response, ClientError>
pub fn switch_client_with_session_flags( &mut self, request: SwitchClientExt2Request, ) -> Result<Response, ClientError>
Sends a further-extended switch-client request over the detached RPC channel.
Sourcepub fn switch_client_with_target_selector(
&mut self,
request: SwitchClientExt3Request,
) -> Result<Response, ClientError>
pub fn switch_client_with_target_selector( &mut self, request: SwitchClientExt3Request, ) -> Result<Response, ClientError>
Sends the most recent switch-client request shape over the detached RPC channel.
Sourcepub fn detach_client(&mut self) -> Result<Response, ClientError>
pub fn detach_client(&mut self) -> Result<Response, ClientError>
Sends a detach-client request over the detached RPC channel.
Sourcepub fn detach_client_extended(
&mut self,
request: DetachClientExtRequest,
) -> Result<Response, ClientError>
pub fn detach_client_extended( &mut self, request: DetachClientExtRequest, ) -> Result<Response, ClientError>
Sends an extended detach-client request over the detached RPC channel.
Sourcepub fn refresh_client(
&mut self,
request: RefreshClientRequest,
) -> Result<Response, ClientError>
pub fn refresh_client( &mut self, request: RefreshClientRequest, ) -> Result<Response, ClientError>
Sends a refresh-client request over the detached RPC channel.
Sourcepub fn list_clients(
&mut self,
request: ListClientsRequest,
) -> Result<Response, ClientError>
pub fn list_clients( &mut self, request: ListClientsRequest, ) -> Result<Response, ClientError>
Sends a list-clients request over the detached RPC channel.
Sourcepub fn suspend_client(
&mut self,
request: SuspendClientRequest,
) -> Result<Response, ClientError>
pub fn suspend_client( &mut self, request: SuspendClientRequest, ) -> Result<Response, ClientError>
Sends a suspend-client request over the detached RPC channel.
Sourcepub fn begin_attach(
self,
target: SessionName,
) -> Result<AttachTransition, ClientError>
pub fn begin_attach( self, target: SessionName, ) -> Result<AttachTransition, ClientError>
Requests an attach upgrade and, on success, yields the raw Unix stream.
Once this method returns AttachTransition::Upgraded, the detached
framing codec is no longer in the data path for the connection.
Sourcepub fn begin_attach_extended(
self,
request: AttachSessionExtRequest,
) -> Result<AttachTransition, ClientError>
pub fn begin_attach_extended( self, request: AttachSessionExtRequest, ) -> Result<AttachTransition, ClientError>
Requests an extended attach upgrade and, on success, yields the raw Unix stream.
Sourcepub fn begin_attach_with_target_spec(
self,
request: AttachSessionExt2Request,
) -> Result<AttachTransition, ClientError>
pub fn begin_attach_with_target_spec( self, request: AttachSessionExt2Request, ) -> Result<AttachTransition, ClientError>
Sends the most recent attach-session request shape over the detached RPC channel.
Sourcepub fn attach_session_with_target_spec_detached(
&mut self,
request: AttachSessionExt2Request,
) -> Result<Response, ClientError>
pub fn attach_session_with_target_spec_detached( &mut self, request: AttachSessionExt2Request, ) -> Result<Response, ClientError>
Sends the most recent attach-session request shape over the detached RPC channel.
Source§impl Connection
impl Connection
Sourcepub fn display_message(
&mut self,
target: Option<Target>,
print: bool,
message: Option<String>,
) -> Result<Response, ClientError>
pub fn display_message( &mut self, target: Option<Target>, print: bool, message: Option<String>, ) -> Result<Response, ClientError>
Sends a display-message request over the detached RPC channel.
Sourcepub fn show_messages(
&mut self,
jobs: bool,
terminals: bool,
target_client: Option<String>,
) -> Result<Response, ClientError>
pub fn show_messages( &mut self, jobs: bool, terminals: bool, target_client: Option<String>, ) -> Result<Response, ClientError>
Sends a show-messages request over the detached RPC channel.
Source§impl Connection
impl Connection
Sourcepub fn resolve_target(
&mut self,
target: Option<String>,
target_type: ResolveTargetType,
window_index: bool,
prefer_unattached: bool,
) -> Result<Response, ClientError>
pub fn resolve_target( &mut self, target: Option<String>, target_type: ResolveTargetType, window_index: bool, prefer_unattached: bool, ) -> Result<Response, ClientError>
Resolves tmux-style raw target text against live server state.
Source§impl Connection
impl Connection
Sourcepub fn new_window(
&mut self,
target: SessionName,
name: Option<String>,
detached: bool,
) -> Result<Response, ClientError>
pub fn new_window( &mut self, target: SessionName, name: Option<String>, detached: bool, ) -> Result<Response, ClientError>
Sends a new-window request over the detached RPC channel.
Sourcepub fn new_window_with_environment(
&mut self,
target: SessionName,
name: Option<String>,
detached: bool,
environment: Option<Vec<String>>,
start_directory: Option<PathBuf>,
command: Option<Vec<String>>,
) -> Result<Response, ClientError>
pub fn new_window_with_environment( &mut self, target: SessionName, name: Option<String>, detached: bool, environment: Option<Vec<String>>, start_directory: Option<PathBuf>, command: Option<Vec<String>>, ) -> Result<Response, ClientError>
Sends a new-window request with explicit spawn environment overrides.
Sourcepub fn new_window_at_with_environment(
&mut self,
target: SessionName,
target_window_index: Option<u32>,
name: Option<String>,
detached: bool,
environment: Option<Vec<String>>,
start_directory: Option<PathBuf>,
command: Option<Vec<String>>,
insert_at_target: bool,
) -> Result<Response, ClientError>
pub fn new_window_at_with_environment( &mut self, target: SessionName, target_window_index: Option<u32>, name: Option<String>, detached: bool, environment: Option<Vec<String>>, start_directory: Option<PathBuf>, command: Option<Vec<String>>, insert_at_target: bool, ) -> Result<Response, ClientError>
Sends a new-window request with an optional destination index.
Sourcepub fn kill_window(
&mut self,
target: WindowTarget,
kill_others: bool,
) -> Result<Response, ClientError>
pub fn kill_window( &mut self, target: WindowTarget, kill_others: bool, ) -> Result<Response, ClientError>
Sends a kill-window request over the detached RPC channel.
Sourcepub fn select_window(
&mut self,
target: WindowTarget,
) -> Result<Response, ClientError>
pub fn select_window( &mut self, target: WindowTarget, ) -> Result<Response, ClientError>
Sends a select-window request over the detached RPC channel.
Sourcepub fn rename_window(
&mut self,
target: WindowTarget,
new_name: String,
) -> Result<Response, ClientError>
pub fn rename_window( &mut self, target: WindowTarget, new_name: String, ) -> Result<Response, ClientError>
Sends a rename-window request over the detached RPC channel.
Sourcepub fn next_window(
&mut self,
target: SessionName,
alerts_only: bool,
) -> Result<Response, ClientError>
pub fn next_window( &mut self, target: SessionName, alerts_only: bool, ) -> Result<Response, ClientError>
Sends a next-window request over the detached RPC channel.
Sourcepub fn previous_window(
&mut self,
target: SessionName,
alerts_only: bool,
) -> Result<Response, ClientError>
pub fn previous_window( &mut self, target: SessionName, alerts_only: bool, ) -> Result<Response, ClientError>
Sends a previous-window request over the detached RPC channel.
Sourcepub fn last_window(
&mut self,
target: SessionName,
) -> Result<Response, ClientError>
pub fn last_window( &mut self, target: SessionName, ) -> Result<Response, ClientError>
Sends a last-window request over the detached RPC channel.
Sourcepub fn list_windows(
&mut self,
target: SessionName,
format: Option<String>,
) -> Result<Response, ClientError>
pub fn list_windows( &mut self, target: SessionName, format: Option<String>, ) -> Result<Response, ClientError>
Sends a list-windows request over the detached RPC channel.
Sourcepub fn link_window(
&mut self,
source: WindowTarget,
target: WindowTarget,
after: bool,
before: bool,
kill_destination: bool,
detached: bool,
) -> Result<Response, ClientError>
pub fn link_window( &mut self, source: WindowTarget, target: WindowTarget, after: bool, before: bool, kill_destination: bool, detached: bool, ) -> Result<Response, ClientError>
Sends a link-window request over the detached RPC channel.
Sourcepub fn move_window(
&mut self,
source: Option<WindowTarget>,
target: MoveWindowTarget,
renumber: bool,
kill_destination: bool,
detached: bool,
) -> Result<Response, ClientError>
pub fn move_window( &mut self, source: Option<WindowTarget>, target: MoveWindowTarget, renumber: bool, kill_destination: bool, detached: bool, ) -> Result<Response, ClientError>
Sends a move-window request over the detached RPC channel.
Sourcepub fn swap_window(
&mut self,
source: WindowTarget,
target: WindowTarget,
detached: bool,
) -> Result<Response, ClientError>
pub fn swap_window( &mut self, source: WindowTarget, target: WindowTarget, detached: bool, ) -> Result<Response, ClientError>
Sends a swap-window request over the detached RPC channel.
Sourcepub fn rotate_window(
&mut self,
target: WindowTarget,
direction: RotateWindowDirection,
) -> Result<Response, ClientError>
pub fn rotate_window( &mut self, target: WindowTarget, direction: RotateWindowDirection, ) -> Result<Response, ClientError>
Sends a rotate-window request over the detached RPC channel.
Sourcepub fn rotate_window_with_zoom(
&mut self,
target: WindowTarget,
direction: RotateWindowDirection,
restore_zoom: bool,
) -> Result<Response, ClientError>
pub fn rotate_window_with_zoom( &mut self, target: WindowTarget, direction: RotateWindowDirection, restore_zoom: bool, ) -> Result<Response, ClientError>
Sends a rotate-window request with zoom save/restore over the detached RPC channel.
Sourcepub fn resize_window(
&mut self,
target: WindowTarget,
width: Option<u16>,
height: Option<u16>,
adjustment: Option<ResizeWindowAdjustment>,
) -> Result<Response, ClientError>
pub fn resize_window( &mut self, target: WindowTarget, width: Option<u16>, height: Option<u16>, adjustment: Option<ResizeWindowAdjustment>, ) -> Result<Response, ClientError>
Sends a resize-window request over the detached RPC channel.
Sourcepub fn unlink_window(
&mut self,
target: WindowTarget,
kill_if_last: bool,
) -> Result<Response, ClientError>
pub fn unlink_window( &mut self, target: WindowTarget, kill_if_last: bool, ) -> Result<Response, ClientError>
Sends an unlink-window request over the detached RPC channel.
Sourcepub fn respawn_window(
&mut self,
target: WindowTarget,
kill: bool,
) -> Result<Response, ClientError>
pub fn respawn_window( &mut self, target: WindowTarget, kill: bool, ) -> Result<Response, ClientError>
Sends a respawn-window request over the detached RPC channel.
Sourcepub fn respawn_window_with_environment(
&mut self,
target: WindowTarget,
kill: bool,
environment: Option<Vec<String>>,
start_directory: Option<PathBuf>,
command: Option<Vec<String>>,
) -> Result<Response, ClientError>
pub fn respawn_window_with_environment( &mut self, target: WindowTarget, kill: bool, environment: Option<Vec<String>>, start_directory: Option<PathBuf>, command: Option<Vec<String>>, ) -> Result<Response, ClientError>
Sends a respawn-window request with explicit spawn environment overrides.
Sourcepub fn split_window(
&mut self,
target: SplitWindowTarget,
) -> Result<Response, ClientError>
pub fn split_window( &mut self, target: SplitWindowTarget, ) -> Result<Response, ClientError>
Sends a split-window request over the detached RPC channel.
Sourcepub fn split_window_with_direction(
&mut self,
target: SplitWindowTarget,
direction: SplitDirection,
) -> Result<Response, ClientError>
pub fn split_window_with_direction( &mut self, target: SplitWindowTarget, direction: SplitDirection, ) -> Result<Response, ClientError>
Sends a split-window request with an explicit direction over the detached RPC channel.
Sourcepub fn split_window_with_direction_and_environment(
&mut self,
target: SplitWindowTarget,
direction: SplitDirection,
environment: Option<Vec<String>>,
) -> Result<Response, ClientError>
pub fn split_window_with_direction_and_environment( &mut self, target: SplitWindowTarget, direction: SplitDirection, environment: Option<Vec<String>>, ) -> Result<Response, ClientError>
Sends a split-window request with explicit spawn environment overrides.
Sourcepub fn split_window_with_spawn(
&mut self,
target: SplitWindowTarget,
direction: SplitDirection,
environment: Option<Vec<String>>,
command: Option<Vec<String>>,
) -> Result<Response, ClientError>
pub fn split_window_with_spawn( &mut self, target: SplitWindowTarget, direction: SplitDirection, environment: Option<Vec<String>>, command: Option<Vec<String>>, ) -> Result<Response, ClientError>
Sends a split-window request with explicit spawn options.
New pane is inserted after the target. To insert before (tmux -b),
use Connection::split_window_with_options.
Sourcepub fn split_window_with_start_directory(
&mut self,
target: SplitWindowTarget,
direction: SplitDirection,
environment: Option<Vec<String>>,
start_directory: Option<PathBuf>,
command: Option<Vec<String>>,
) -> Result<Response, ClientError>
pub fn split_window_with_start_directory( &mut self, target: SplitWindowTarget, direction: SplitDirection, environment: Option<Vec<String>>, start_directory: Option<PathBuf>, command: Option<Vec<String>>, ) -> Result<Response, ClientError>
Sends a split-window request with an optional working-directory override.
New pane is inserted after the target. To insert before (tmux -b),
use Connection::split_window_with_options without a start directory.
Sourcepub fn split_window_with_options(
&mut self,
options: SplitWindowOptions,
) -> Result<Response, ClientError>
pub fn split_window_with_options( &mut self, options: SplitWindowOptions, ) -> Result<Response, ClientError>
Sends a split-window request with full options including before.
Sourcepub fn select_layout(
&mut self,
target: SelectLayoutTarget,
layout: LayoutName,
) -> Result<Response, ClientError>
pub fn select_layout( &mut self, target: SelectLayoutTarget, layout: LayoutName, ) -> Result<Response, ClientError>
Sends a select-layout request over the detached RPC channel.
Sourcepub fn select_custom_layout(
&mut self,
target: SelectLayoutTarget,
layout: String,
) -> Result<Response, ClientError>
pub fn select_custom_layout( &mut self, target: SelectLayoutTarget, layout: String, ) -> Result<Response, ClientError>
Sends a select-layout custom layout request over the detached RPC channel.
Sourcepub fn next_layout(
&mut self,
target: WindowTarget,
) -> Result<Response, ClientError>
pub fn next_layout( &mut self, target: WindowTarget, ) -> Result<Response, ClientError>
Sends a next-layout request over the detached RPC channel.
Sourcepub fn previous_layout(
&mut self,
target: WindowTarget,
) -> Result<Response, ClientError>
pub fn previous_layout( &mut self, target: WindowTarget, ) -> Result<Response, ClientError>
Sends a previous-layout request over the detached RPC channel.
Source§impl Connection
impl Connection
Sourcepub fn roundtrip(&mut self, request: &Request) -> Result<Response, ClientError>
pub fn roundtrip(&mut self, request: &Request) -> Result<Response, ClientError>
Sends a request and reads the server’s response.
Server-side Response::Error payloads are returned as-is in the Ok
variant so callers can pattern-match on them. Only transport and framing
failures produce Err.
Sourcepub fn supports_capability(
&mut self,
capability: &str,
) -> Result<bool, ClientError>
pub fn supports_capability( &mut self, capability: &str, ) -> Result<bool, ClientError>
Returns whether the connected daemon advertises a protocol capability.
Optional client behavior uses this as a soft gate: older daemons that do not answer the handshake shape or report an error are treated as not supporting the capability, leaving the connection usable for legacy requests.
Source§impl Connection
impl Connection
Sourcepub fn begin_control_mode(
self,
mode: ControlMode,
client_terminal: ClientTerminalContext,
) -> Result<ControlTransition, ClientError>
pub fn begin_control_mode( self, mode: ControlMode, client_terminal: ClientTerminalContext, ) -> Result<ControlTransition, ClientError>
Requests a control-mode upgrade and, on success, yields the raw local stream for tmux-compatible text control traffic.