Skip to main content

Window

Struct Window 

Source
pub struct Window<S> {
    pub id: String,
    /* private fields */
}
Expand description

A handle to an iTerm2 window.

Fields§

§id: String

The unique window identifier.

Implementations§

Source§

impl<S: AsyncRead + AsyncWrite + Unpin + Send + 'static> Window<S>

Source

pub fn new(id: String, conn: Arc<Connection<S>>) -> Result<Self>

Create a window handle. Validates the window ID.

Source

pub async fn create_tab( &self, profile_name: Option<&str>, ) -> Result<CreateTabResult>

Create a new tab in this window, optionally using a named profile.

Source

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

Activate this window (bring it to the front).

Source

pub async fn close(&self, force: bool) -> Result<()>

Close this window. If force is true, skip the confirmation prompt.

Source

pub async fn get_property(&self, name: &str) -> Result<Option<String>>

Get a window property (e.g. "frame", "fullscreen"). Returns JSON-encoded value.

Source

pub async fn set_property(&self, name: &str, json_value: &str) -> Result<()>

Set a window property. Value must be valid JSON.

Source

pub async fn get_variable(&self, name: &str) -> Result<Option<String>>

Get a window variable by name. Returns JSON-encoded value.

Source

pub fn connection(&self) -> &Connection<S>

Get a reference to the underlying connection.

Auto Trait Implementations§

§

impl<S> Freeze for Window<S>

§

impl<S> !RefUnwindSafe for Window<S>

§

impl<S> Send for Window<S>
where S: Send,

§

impl<S> Sync for Window<S>
where S: Send,

§

impl<S> Unpin for Window<S>

§

impl<S> UnsafeUnpin for Window<S>

§

impl<S> !UnwindSafe for Window<S>

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, 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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V