Struct tmux_lib::window::Window

source ·
pub struct Window {
    pub id: WindowId,
    pub index: u16,
    pub is_active: bool,
    pub layout: String,
    pub name: String,
    pub sessions: Vec<String>,
}
Expand description

A Tmux window.

Fields

id: WindowId

Window identifier, e.g. @3.

index: u16

Index of the Window in the Session.

is_active: bool

Describes whether the Window is active.

layout: String

Describes how panes are laid out in the Window.

name: String

Name of the Window.

sessions: Vec<String>

Name of Sessions to which this Window is attached.

Implementations

Return all PaneId in this window.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more

Parse a string containing the tmux window status into a new Window.

This returns a Result<Window, Error> as this call can obviously fail if provided an invalid format.

The expected format of the tmux status is

@1:0:true:035d,334x85,0,0{167x85,0,0,1,166x85,168,0[166x48,168,0,2,166x36,168,49,3]}:'ignite':'pytorch'
@2:1:false:4438,334x85,0,0[334x41,0,0{167x41,0,0,4,166x41,168,0,5},334x43,0,42{167x43,0,42,6,166x43,168,42,7}]:'dates-attn':'pytorch'
@3:2:false:9e8b,334x85,0,0{167x85,0,0,8,166x85,168,0,9}:'th-bits':'pytorch'
@4:3:false:64ef,334x85,0,0,10:'docker-pytorch':'pytorch'
@5:0:true:64f0,334x85,0,0,11:'ben':'rust'
@6:1:false:64f1,334x85,0,0,12:'pyo3':'rust'
@7:2:false:64f2,334x85,0,0,13:'mdns-repeater':'rust'
@8:0:true:64f3,334x85,0,0,14:'combine':'swift'
@9:0:false:64f4,334x85,0,0,15:'copyrat':'tmux-hacking'
@10:1:false:ae3a,334x85,0,0[334x48,0,0,17,334x36,0,49{175x36,0,49,18,158x36,176,49,19}]:'mytui-app':'tmux-hacking'
@11:2:true:e2e2,334x85,0,0{175x85,0,0,20,158x85,176,0[158x42,176,0,21,158x42,176,43,27]}:'tmux-backup':'tmux-hacking'

This status line is obtained with

tmux list-windows -a -F "#{window_id}:#{window_index}:#{?window_active,true,false}:#{window_layout}:'#{window_name}':'#{window_linked_sessions_list}'"

For definitions, look at Window type and the tmux man page for definitions.

The associated error which can be returned from parsing.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.