Skip to main content

Connection

Struct Connection 

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

A blocking connection to the RMUX server that exchanges typed frames.

Implementations§

Source§

impl Connection

Source

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.

Source

pub fn set_buffer_target_client( &mut self, name: Option<String>, content: Vec<u8>, append: bool, new_name: Option<String>, set_clipboard: bool, target_client: Option<String>, ) -> Result<Response, ClientError>

Sends a target-client-aware set-buffer request.

Source

pub fn show_buffer( &mut self, name: Option<String>, ) -> Result<Response, ClientError>

Sends a show-buffer request over the detached RPC channel.

Source

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.

Source

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.

Source

pub fn delete_buffer( &mut self, name: Option<String>, ) -> Result<Response, ClientError>

Sends a delete-buffer request over the detached RPC channel.

Source

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.

Source

pub fn load_buffer_target_client( &mut self, path: String, name: Option<String>, set_clipboard: bool, target_client: Option<String>, ) -> Result<Response, ClientError>

Sends a target-client-aware load-buffer request.

Source

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.

Source

pub fn capture_pane( &mut self, request: CapturePaneRequest, ) -> Result<Response, ClientError>

Sends a capture-pane request over the detached RPC channel.

Source

pub fn capture_pane_target_action( &mut self, request: CapturePaneTargetActionRequest, ) -> Result<Response, ClientError>

Sends a capture-pane request with server-side target resolution.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn show_options( &mut self, scope: OptionScopeSelector, name: Option<String>, value_only: bool, include_inherited: bool, quiet: bool, ) -> Result<Response, ClientError>

Sends a show-options request over the detached RPC channel.

Source

pub fn show_options_extended( &mut self, scope: OptionScopeSelector, name: Option<String>, value_only: bool, include_inherited: bool, quiet: bool, include_hooks: bool, ) -> Result<Response, ClientError>

Sends an extended show-options request.

Source

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.

Source

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.

Source

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

Source

pub fn bind_key( &mut self, request: BindKeyRequest, ) -> Result<Response, ClientError>

Sends a bind-key request over the detached RPC channel.

Source

pub fn unbind_key( &mut self, request: UnbindKeyRequest, ) -> Result<Response, ClientError>

Sends an unbind-key request over the detached RPC channel.

Source

pub fn list_keys( &mut self, request: ListKeysRequest, ) -> Result<Response, ClientError>

Sends a list-keys request over the detached RPC channel.

Source§

impl Connection

Source

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.

Source

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.

Source

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.

Source

pub fn last_pane( &mut self, target: WindowTarget, ) -> Result<Response, ClientError>

Sends a last-pane request over the detached RPC channel.

Source

pub fn last_pane_with_zoom( &mut self, target: WindowTarget, preserve_zoom: bool, ) -> Result<Response, ClientError>

Sends a last-pane request with optional zoom preservation.

Source

pub fn last_pane_with_options( &mut self, target: WindowTarget, preserve_zoom: bool, input_disabled: Option<bool>, ) -> Result<Response, ClientError>

Sends a last-pane request with tmux selection options.

Source

pub fn join_pane( &mut self, request: JoinPaneRequest, ) -> Result<Response, ClientError>

Sends a join-pane request over the detached RPC channel.

Source

pub fn move_pane( &mut self, request: MovePaneRequest, ) -> Result<Response, ClientError>

Sends a move-pane request over the detached RPC channel.

Source

pub fn break_pane( &mut self, request: BreakPaneRequest, ) -> Result<Response, ClientError>

Sends a break-pane request over the detached RPC channel.

Source

pub fn resize_pane( &mut self, target: PaneTarget, adjustment: ResizePaneAdjustment, ) -> Result<Response, ClientError>

Sends a resize-pane request over the detached RPC channel.

Source

pub fn resize_pane_target_action( &mut self, request: ResizePaneTargetActionRequest, ) -> Result<Response, ClientError>

Sends a resize-pane request with server-side target resolution.

Source

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.

Source

pub fn display_panes_target_client( &mut self, target: SessionName, duration_ms: Option<u64>, non_blocking: bool, no_command: bool, template: Option<String>, target_client: Option<String>, ) -> Result<Response, ClientError>

Sends a target-client-aware display-panes request.

Source

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.

Source

pub fn respawn_pane( &mut self, request: RespawnPaneRequest, ) -> Result<Response, ClientError>

Sends a respawn-pane request over the detached RPC channel.

Source

pub fn select_pane( &mut self, target: PaneTarget, ) -> Result<Response, ClientError>

Sends a select-pane request over the detached RPC channel.

Source

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.

Source

pub fn select_pane_with_title_and_zoom( &mut self, target: PaneTarget, title: Option<String>, preserve_zoom: bool, ) -> Result<Response, ClientError>

Sends a select-pane request with optional title and zoom preservation.

Source

pub fn select_pane_with_options( &mut self, target: PaneTarget, title: Option<String>, style: Option<String>, input_disabled: Option<bool>, preserve_zoom: bool, ) -> Result<Response, ClientError>

Sends a select-pane request with optional title, style, input state, and zoom preservation.

Source

pub fn select_pane_input( &mut self, target: PaneTarget, disabled: bool, ) -> Result<Response, ClientError>

Sends a select-pane -d / -e input-state request.

Source

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.

Source

pub fn select_pane_adjacent_with_zoom( &mut self, target: PaneTarget, direction: SelectPaneDirection, preserve_zoom: bool, ) -> Result<Response, ClientError>

Sends a directional select-pane request with optional zoom preservation.

Source

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.

Source

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.

Source

pub fn kill_pane(&mut self, target: PaneTarget) -> Result<Response, ClientError>

Sends a kill-pane request over the detached RPC channel.

Source

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.

Source

pub fn send_keys( &mut self, target: PaneTarget, keys: Vec<String>, ) -> Result<Response, ClientError>

Sends a send-keys request over the detached RPC channel.

Source

pub fn send_keys_extended( &mut self, request: SendKeysExtRequest, ) -> Result<Response, ClientError>

Sends an extended send-keys request over the detached RPC channel.

Source

pub fn send_keys_extended_target_client( &mut self, request: SendKeysExt2Request, ) -> Result<Response, ClientError>

Sends a target-client aware send-keys request over detached RPC.

Source

pub fn pane_input( &mut self, request: PaneInputRequest, ) -> Result<Response, ClientError>

Sends a stable-target SDK pane input request over detached RPC.

Source

pub fn pane_broadcast_input( &mut self, request: PaneBroadcastInputRequest, ) -> Result<Response, ClientError>

Sends a stable-target SDK pane input broadcast request over detached RPC.

Source

pub fn pane_snapshot_ref( &mut self, target: PaneTargetRef, ) -> Result<Response, ClientError>

Captures a stable-target structured pane snapshot over detached RPC.

Source

pub fn subscribe_pane_output_ref( &mut self, target: PaneTargetRef, start: PaneOutputSubscriptionStart, ) -> Result<Response, ClientError>

Subscribes to stable-target pane output.

Source

pub fn pane_output_cursor( &mut self, subscription_id: PaneOutputSubscriptionId, max_events: Option<u16>, ) -> Result<Response, ClientError>

Polls a pane-output subscription cursor.

Source

pub fn unsubscribe_pane_output( &mut self, subscription_id: PaneOutputSubscriptionId, ) -> Result<Response, ClientError>

Unsubscribes from pane output.

Source

pub fn sdk_wait_for_output_ref( &mut self, owner_id: SdkWaitOwnerId, wait_id: SdkWaitId, target: PaneTargetRef, bytes: Vec<u8>, start: PaneOutputSubscriptionStart, ) -> Result<Response, ClientError>

Arms a daemon-backed stable-target SDK byte wait.

Source

pub fn arm_sdk_wait_for_output_ref( &mut self, owner_id: SdkWaitOwnerId, wait_id: SdkWaitId, target: PaneTargetRef, bytes: Vec<u8>, start: PaneOutputSubscriptionStart, ) -> Result<(), ClientError>

Writes a stable-target SDK byte wait request without reading its response.

Callers use this to arm a future-output wait before performing another action, then read the response later on the same connection.

Source

pub fn cancel_sdk_wait( &mut self, owner_id: SdkWaitOwnerId, wait_id: SdkWaitId, ) -> Result<Response, ClientError>

Cancels a daemon-backed SDK byte wait.

Source

pub fn send_prefix( &mut self, target: Option<PaneTarget>, secondary: bool, ) -> Result<Response, ClientError>

Sends a send-prefix request over the detached RPC channel.

Source

pub fn copy_mode( &mut self, request: CopyModeRequest, ) -> Result<Response, ClientError>

Sends a copy-mode request over the detached RPC channel.

Source

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

Source

pub fn run_shell( &mut self, command: String, arguments: Vec<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.

Source

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.

Source

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

Source

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.

Source

pub fn kill_server(&mut self) -> Result<Response, ClientError>

Sends a kill-server request over the detached RPC channel.

Source

pub fn kill_server_after_write(&mut self) -> Result<(), ClientError>

Sends a kill-server request and returns after the frame is written.

Windows package clients use this because the daemon can close its reply pipe during shutdown. Callers must then drop this connection and wait for endpoint release with crate::wait_for_server_endpoint_cleanup.

Source

pub fn kill_server_legacy_wire( &mut self, wire_version: u32, ) -> Result<(), ClientError>

Sends a legacy-wire kill-server request for stale daemon cleanup.

Source

pub fn daemon_status(&mut self) -> Result<Response, ClientError>

Sends an internal daemon status request over the detached RPC channel.

Source

pub fn shutdown_if_idle(&mut self) -> Result<Response, ClientError>

Sends an internal idle-only daemon shutdown request.

Source

pub fn lock_server(&mut self) -> Result<Response, ClientError>

Sends a lock-server request over the detached RPC channel.

Source

pub fn lock_session( &mut self, target: SessionName, ) -> Result<Response, ClientError>

Sends a lock-session request over the detached RPC channel.

Source

pub fn lock_client( &mut self, target_client: String, ) -> Result<Response, ClientError>

Sends a lock-client request over the detached RPC channel.

Source

pub fn server_access( &mut self, request: ServerAccessRequest, ) -> Result<Response, ClientError>

Sends a server-access request over the detached RPC channel.

Source§

impl Connection

Source

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.

Source

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.

Source

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.

Source

pub fn has_session( &mut self, target: SessionName, ) -> Result<Response, ClientError>

Sends a has-session request over the detached RPC channel.

Source

pub fn kill_session( &mut self, request: KillSessionRequest, ) -> Result<Response, ClientError>

Sends a kill-session request over the detached RPC channel.

Source

pub fn rename_session( &mut self, target: SessionName, new_name: SessionName, ) -> Result<Response, ClientError>

Sends a rename-session request over the detached RPC channel.

Source

pub fn create_session_lease( &mut self, session_name: SessionName, ttl_millis: u64, ) -> Result<Response, ClientError>

Creates an SDK-owned session lease.

Source

pub fn renew_session_lease( &mut self, session_name: SessionName, token: u64, ttl_millis: u64, ) -> Result<Response, ClientError>

Renews an SDK-owned session lease.

Source

pub fn release_session_lease( &mut self, session_name: SessionName, token: u64, ) -> Result<Response, ClientError>

Releases an SDK-owned session lease.

Source

pub fn list_sessions( &mut self, request: ListSessionsRequest, ) -> Result<Response, ClientError>

Sends a list-sessions request over the detached RPC channel.

Source

pub fn list_panes( &mut self, target: SessionName, format: Option<String>, ) -> Result<Response, ClientError>

Sends a list-panes request over the detached RPC channel.

Source

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.

Source

pub fn list_panes_in_window_with_options( &mut self, target: SessionName, target_window_index: Option<u32>, format: Option<String>, filter: Option<String>, sort_order: Option<String>, reversed: bool, ) -> Result<Response, ClientError>

Sends a list-panes request scoped to an optional window index, with filtering and ordering options.

Source

pub fn switch_client( &mut self, target: SessionName, ) -> Result<Response, ClientError>

Sends a switch-client request over the detached RPC channel.

Source

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.

Source

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.

Source

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.

Source

pub fn detach_client(&mut self) -> Result<Response, ClientError>

Sends a detach-client request over the detached RPC channel.

Source

pub fn detach_client_extended( &mut self, request: DetachClientExtRequest, ) -> Result<Response, ClientError>

Sends an extended detach-client request over the detached RPC channel.

Source

pub fn refresh_client( &mut self, request: RefreshClientRequest, ) -> Result<Response, ClientError>

Sends a refresh-client request over the detached RPC channel.

Source

pub fn list_clients( &mut self, request: ListClientsRequest, ) -> Result<Response, ClientError>

Sends a list-clients request over the detached RPC channel.

Source

pub fn suspend_client( &mut self, request: SuspendClientRequest, ) -> Result<Response, ClientError>

Sends a suspend-client request over the detached RPC channel.

Source

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.

Source

pub fn begin_attach_extended( self, request: AttachSessionExtRequest, ) -> Result<AttachTransition, ClientError>

Requests an extended attach upgrade and, on success, yields the raw Unix stream.

Source

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.

Source

pub fn begin_attach_with_capabilities( self, request: AttachSessionExt3Request, ) -> Result<AttachTransition, ClientError>

Sends a capability-aware attach-session request over the detached RPC channel.

Source

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

Source

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.

Source

pub fn display_message_ext( &mut self, target: Option<Target>, print: bool, message: Option<String>, target_client: Option<String>, ) -> Result<Response, ClientError>

Sends a display-message -c request over the detached RPC channel.

Source

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

Source

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

Source

pub fn web_share( &mut self, request: WebShareRequest, ) -> Result<Response, ClientError>

Sends a web-share request over the detached RPC channel.

Source§

impl Connection

Source

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.

Source

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.

Source

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.

Source

pub fn kill_window( &mut self, target: WindowTarget, kill_others: bool, ) -> Result<Response, ClientError>

Sends a kill-window request over the detached RPC channel.

Source

pub fn select_window( &mut self, target: WindowTarget, ) -> Result<Response, ClientError>

Sends a select-window request over the detached RPC channel.

Source

pub fn rename_window( &mut self, target: WindowTarget, new_name: String, ) -> Result<Response, ClientError>

Sends a rename-window request over the detached RPC channel.

Source

pub fn next_window( &mut self, target: SessionName, alerts_only: bool, ) -> Result<Response, ClientError>

Sends a next-window request over the detached RPC channel.

Source

pub fn previous_window( &mut self, target: SessionName, alerts_only: bool, ) -> Result<Response, ClientError>

Sends a previous-window request over the detached RPC channel.

Source

pub fn last_window( &mut self, target: SessionName, ) -> Result<Response, ClientError>

Sends a last-window request over the detached RPC channel.

Source

pub fn list_windows( &mut self, target: SessionName, format: Option<String>, ) -> Result<Response, ClientError>

Sends a list-windows request over the detached RPC channel.

Source

pub fn list_windows_with_options( &mut self, target: SessionName, format: Option<String>, filter: Option<String>, sort_order: Option<String>, reversed: bool, ) -> Result<Response, ClientError>

Sends a list-windows request with filtering and ordering options.

Sends a link-window request over the detached RPC channel.

Source

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.

Source

pub fn move_window_with_position( &mut self, source: Option<WindowTarget>, target: MoveWindowTarget, renumber: bool, kill_destination: bool, detached: bool, after: bool, before: bool, ) -> Result<Response, ClientError>

Sends a move-window request with optional -a/-b placement over the detached RPC channel.

Source

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.

Source

pub fn rotate_window( &mut self, target: WindowTarget, direction: RotateWindowDirection, ) -> Result<Response, ClientError>

Sends a rotate-window request over the detached RPC channel.

Source

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.

Source

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.

Sends an unlink-window request over the detached RPC channel.

Source

pub fn respawn_window( &mut self, target: WindowTarget, kill: bool, ) -> Result<Response, ClientError>

Sends a respawn-window request over the detached RPC channel.

Source

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.

Source

pub fn split_window( &mut self, target: SplitWindowTarget, ) -> Result<Response, ClientError>

Sends a split-window request over the detached RPC channel.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn split_window_with_options( &mut self, options: SplitWindowOptions, ) -> Result<Response, ClientError>

Sends a split-window request with full options including before.

Source

pub fn split_window_target_action( &mut self, request: SplitWindowTargetActionRequest, ) -> Result<Response, ClientError>

Sends a split-window request with server-side target resolution.

Source

pub fn select_layout( &mut self, target: SelectLayoutTarget, layout: LayoutName, ) -> Result<Response, ClientError>

Sends a select-layout request over the detached RPC channel.

Source

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.

Source

pub fn select_old_layout( &mut self, target: SelectLayoutTarget, ) -> Result<Response, ClientError>

Sends a select-layout -o request over the detached RPC channel.

Source

pub fn spread_layout( &mut self, target: SelectLayoutTarget, ) -> Result<Response, ClientError>

Sends a select-layout -E request over the detached RPC channel.

Source

pub fn next_layout( &mut self, target: WindowTarget, ) -> Result<Response, ClientError>

Sends a next-layout request over the detached RPC channel.

Source

pub fn previous_layout( &mut self, target: WindowTarget, ) -> Result<Response, ClientError>

Sends a previous-layout request over the detached RPC channel.

Source§

impl Connection

Source

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.

Source

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

pub fn read_response_without_read_timeout( &mut self, ) -> Result<Response, ClientError>

Reads the next detached response without a response read timeout.

This is used for already-armed long-running requests where another connection may cancel the server-side wait on timeout.

Source

pub fn read_response_with_read_timeout( &mut self, timeout: Duration, ) -> Result<Response, ClientError>

Reads the next detached response with a caller-provided read timeout.

Source§

impl Connection

Source

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.

Source

pub fn begin_control_mode_with_initial_commands( self, mode: ControlMode, client_terminal: ClientTerminalContext, initial_commands: &[String], ) -> Result<ControlTransition, ClientError>

Requests a control-mode upgrade and writes command-line commands across the upgrade boundary so the server can frame them as tmux argv commands.

Trait Implementations§

Source§

impl Debug for Connection

Source§

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

Formats the value using the given formatter. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more