pub struct Window<S> {
pub id: String,
/* private fields */
}Expand description
A handle to an iTerm2 window.
Fields§
§id: StringThe unique window identifier.
Implementations§
Source§impl<S: AsyncRead + AsyncWrite + Unpin + Send + 'static> Window<S>
impl<S: AsyncRead + AsyncWrite + Unpin + Send + 'static> Window<S>
Sourcepub fn new(id: String, conn: Arc<Connection<S>>) -> Result<Self>
pub fn new(id: String, conn: Arc<Connection<S>>) -> Result<Self>
Create a window handle. Validates the window ID.
Sourcepub async fn create_tab(
&self,
profile_name: Option<&str>,
) -> Result<CreateTabResult>
pub async fn create_tab( &self, profile_name: Option<&str>, ) -> Result<CreateTabResult>
Create a new tab in this window, optionally using a named profile.
Sourcepub async fn close(&self, force: bool) -> Result<()>
pub async fn close(&self, force: bool) -> Result<()>
Close this window. If force is true, skip the confirmation prompt.
Sourcepub async fn get_property(&self, name: &str) -> Result<Option<String>>
pub async fn get_property(&self, name: &str) -> Result<Option<String>>
Get a window property (e.g. "frame", "fullscreen"). Returns JSON-encoded value.
Sourcepub async fn set_property(&self, name: &str, json_value: &str) -> Result<()>
pub async fn set_property(&self, name: &str, json_value: &str) -> Result<()>
Set a window property. Value must be valid JSON.
Sourcepub async fn get_variable(&self, name: &str) -> Result<Option<String>>
pub async fn get_variable(&self, name: &str) -> Result<Option<String>>
Get a window variable by name. Returns JSON-encoded value.
Sourcepub fn connection(&self) -> &Connection<S>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more