pub struct Window { /* private fields */ }Expand description
Opaque handle for one daemon window slot.
A window handle addresses a session/index pair rather than caching a
WindowId. Every operation resolves that slot against the daemon’s current
state, so linked windows and grouped sessions follow tmux visibility rules:
closing one visible link removes the underlying window and panes from every
linked or grouped listing, while stale handles for any affected slot return
typed empty/already-closed results where the operation supports them.
Implementations§
Source§impl Window
impl Window
Sourcepub const fn target(&self) -> &WindowRef
pub const fn target(&self) -> &WindowRef
Returns the exact protocol-owned window target addressed by this handle.
Sourcepub const fn endpoint(&self) -> &RmuxEndpoint
pub const fn endpoint(&self) -> &RmuxEndpoint
Returns the endpoint that was resolved when this handle was created.
Sourcepub const fn configured_default_timeout(&self) -> Option<Duration>
pub const fn configured_default_timeout(&self) -> Option<Duration>
Returns the default timeout configured on the parent facade.
Sourcepub async fn id(&self) -> Result<Option<WindowId>>
pub async fn id(&self) -> Result<Option<WindowId>>
Returns the stable daemon window identity for this slot, when it is currently listed.
Sourcepub async fn exists(&self) -> Result<bool>
pub async fn exists(&self) -> Result<bool>
Checks whether this exact window slot is currently listed by the daemon.
Sourcepub async fn panes(&self) -> Result<Vec<WindowPane>>
pub async fn panes(&self) -> Result<Vec<WindowPane>>
Lists panes currently visible through this window slot.
Sourcepub async fn info(&self) -> Result<InfoSnapshot>
pub async fn info(&self) -> Result<InfoSnapshot>
Returns a sticky info snapshot for this window and its listed panes.
The snapshot is assembled from live daemon list-sessions,
list-windows, and list-panes responses. If the target has already
been closed, the returned snapshot contains only the still-observable
session metadata, or is empty when the session is gone.
Sourcepub async fn resize(
&self,
width: Option<u16>,
height: Option<u16>,
) -> Result<()>
pub async fn resize( &self, width: Option<u16>, height: Option<u16>, ) -> Result<()>
Requests an absolute size for this window.
Passing None for one dimension leaves that dimension to the daemon.
Sourcepub async fn select_layout(&self, layout: LayoutName) -> Result<()>
pub async fn select_layout(&self, layout: LayoutName) -> Result<()>
Applies a named layout to this window.
Sourcepub async fn close(self) -> Result<WindowCloseOutcome>
pub async fn close(self) -> Result<WindowCloseOutcome>
Consumes this handle and kills the addressed window through the daemon.
A stale handle is treated as an idempotent no-op and returns
WindowCloseOutcome::AlreadyClosed. Linked or grouped views of the
same underlying window are removed together by the daemon. Other daemon
errors, such as attempting to kill the only window in a session, are
returned.