pub struct ControlClient { /* private fields */ }Implementations§
Source§impl ControlClient
impl ControlClient
Sourcepub fn attach(tmux: &Tmux, session: &str, size: (u16, u16)) -> Result<Self>
pub fn attach(tmux: &Tmux, session: &str, size: (u16, u16)) -> Result<Self>
Attach to session in control mode.
Sourcepub fn send_command(&mut self, command: &str) -> Result<()>
pub fn send_command(&mut self, command: &str) -> Result<()>
Send a tmux command. Its reply arrives as an Event::CommandReply.
pub fn try_event(&self) -> Result<Event, TryRecvError>
Sourcepub fn next_event(&self, timeout: Duration) -> Result<Event>
pub fn next_event(&self, timeout: Duration) -> Result<Event>
Block for the next event, up to timeout.
Sourcepub fn wait_for(
&self,
timeout: Duration,
predicate: impl FnMut(&Event) -> bool,
) -> Result<Vec<Event>>
pub fn wait_for( &self, timeout: Duration, predicate: impl FnMut(&Event) -> bool, ) -> Result<Vec<Event>>
Collect events until predicate matches, or timeout elapses.
Returns everything seen, matching event last. Useful because tmux interleaves pane output with command replies.
Sourcepub fn resize(&mut self, cols: u16, rows: u16) -> Result<()>
pub fn resize(&mut self, cols: u16, rows: u16) -> Result<()>
Tell tmux the client’s terminal changed size.
tmux ignores the pty winsize of a control-mode client entirely — the
only thing that moves a pane is refresh-client -C. Resizing the pty
alone leaves the pane at its creation size while the emulator believes
otherwise, and every absolute cursor address then lands on the wrong row.
The pty is resized too so the two agree, but the command is what counts.
Trait Implementations§
Source§impl Drop for ControlClient
impl Drop for ControlClient
Auto Trait Implementations§
impl !RefUnwindSafe for ControlClient
impl !Sync for ControlClient
impl !UnwindSafe for ControlClient
impl Freeze for ControlClient
impl Send for ControlClient
impl Unpin for ControlClient
impl UnsafeUnpin for ControlClient
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more