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§

source§

impl Window

source

pub fn pane_ids(&self) -> Vec<PaneId>

Return all PaneId in this window.

Trait Implementations§

source§

impl Clone for Window

source§

fn clone(&self) -> Window

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Window

source§

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

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Window

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl FromStr for Window

source§

fn from_str(input: &str) -> Result<Self, Self::Err>

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.

§

type Err = Error

The associated error which can be returned from parsing.
source§

impl PartialEq<Window> for Window

source§

fn eq(&self, other: &Window) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Window

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Window

source§

impl StructuralEq for Window

source§

impl StructuralPartialEq for Window

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,