control.ControlEvents
Rust
- Python Unavailable
- TypeScript Unavailable
- Rust
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- control
- Package
- libtmux
- Source
- crates/libtmux/src/control.rs
-
Receives tmux notifications and terminal connection errors.
This is a
Stream<Item = Result<Event, Error>>. Notifications arrive in order. A connection failure follows all buffered notifications as oneErr; subsequent polls returnNone. A normal tmux%exitarrives asEvent::Exitand is followed byNoneafter cleanup succeeds. EOF without%exitiscrate::ControlModeErrorKind::Closed.Server::shutdownmay discard notifications still waiting for delivery so an unread stream cannot prevent executor shutdown.Exhaustion waits for connection cleanup.
Self::shutdowncloses 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.
2 declared, 0 inherited
Members
- next_event method Return the next notification or terminal error, then
None. - shutdown method End the connection and report how it went.