Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

struct libtmux-rs latest

ControlEvents

Receives tmux notifications and terminal connection errors.

Source and package
Qualified name
libtmux::control::ControlEvents
Module
control
Package
libtmux
Source
crates/libtmux/src/control.rs
struct control.ControlEvents

Description#

This is a Stream<Item = Result<Event, Error>>. Notifications arrive in order. A connection failure follows all buffered notifications as one Err; subsequent polls return None. A normal tmux %exit arrives as Event::Exit and is followed by None after cleanup succeeds. EOF without %exit is crate::ControlModeErrorKind::Closed. Server::shutdown() may discard notifications still waiting for delivery so an unread stream cannot prevent executor shutdown.

Exhaustion waits for connection cleanup. Self::shutdown() closes early and returns any terminal error the stream has not already delivered.

Events are buffered, and a consumer that stops reading eventually stops the connection reading from tmux, which is the backpressure tmux already expects from a slow client. During normal operation nothing is dropped; commands wait instead. Drop this handle to opt out of events entirely and the connection runs on.

Members2#

  • next_event method Return the next notification or terminal error, then None.
  • shutdown method End the connection and report how it went.
Esc

Type to search.

Reference previewOpen reference