pub struct Client { /* private fields */ }Expand description
A tmux client discovered with list-clients.
Implementations§
Source§impl Client
impl Client
Sourcepub const fn name(&self) -> &ClientName
pub const fn name(&self) -> &ClientName
Returns the byte-preserving tmux client name.
Sourcepub const fn session_name(&self) -> Option<&SessionName>
pub const fn session_name(&self) -> Option<&SessionName>
Returns the attached session name captured by this snapshot.
Sourcepub const fn snapshot(&self) -> &ClientSnapshot
pub const fn snapshot(&self) -> &ClientSnapshot
Returns the owned client snapshot.
Sourcepub async fn refresh(&mut self) -> Result<()>
pub async fn refresh(&mut self) -> Result<()>
Replaces this object’s state with a fresh client snapshot.
Sourcepub async fn session(&self) -> Result<Option<Session>>
pub async fn session(&self) -> Result<Option<Session>>
Resolves the currently attached session, if any.
Sourcepub async fn window(&self) -> Result<Option<Window>>
pub async fn window(&self) -> Result<Option<Window>>
Resolves the active window attached to this client.
Sourcepub async fn pane(&self) -> Result<Option<Pane>>
pub async fn pane(&self) -> Result<Option<Pane>>
Resolves the active pane attached to this client.
Sourcepub async fn cmd(&self, command: Command) -> Result<CommandResult>
pub async fn cmd(&self, command: Command) -> Result<CommandResult>
Runs an arbitrary tmux command targeted at this client.
Sourcepub async fn switch_session(
&self,
target: impl Into<SessionTarget>,
) -> Result<()>
pub async fn switch_session( &self, target: impl Into<SessionTarget>, ) -> Result<()>
Switches this client to another session.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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