Skip to main content

Window

Struct Window 

Source
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

Source

pub const fn target(&self) -> &WindowRef

Returns the exact protocol-owned window target addressed by this handle.

Source

pub const fn endpoint(&self) -> &RmuxEndpoint

Returns the endpoint that was resolved when this handle was created.

Source

pub const fn configured_default_timeout(&self) -> Option<Duration>

Returns the default timeout configured on the parent facade.

Source

pub async fn id(&self) -> Result<Option<WindowId>>

Returns the stable daemon window identity for this slot, when it is currently listed.

Source

pub async fn exists(&self) -> Result<bool>

Checks whether this exact window slot is currently listed by the daemon.

Source

pub async fn panes(&self) -> Result<Vec<WindowPane>>

Lists panes currently visible through this window slot.

Source

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.

Source

pub async fn select(&self) -> Result<()>

Selects this window in its session.

Source

pub async fn rename(&self, name: impl Into<String>) -> Result<()>

Renames this window.

Source

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.

Source

pub async fn select_layout(&self, layout: LayoutName) -> Result<()>

Applies a named layout to this window.

Source

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.

Trait Implementations§

Source§

impl Clone for Window

Source§

fn clone(&self) -> Window

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 Window

Source§

fn fmt(&self, formatter: &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> 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.