# control.ControlEvents.next_event

- **Module:** control.ControlEvents
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/control.rs#L1237
- **Page:** https://libtmux.org/en/rs/latest/reference/control-controlevents-next_event/

```
control.ControlEvents.next_event(mut) -> Option<Result<Event, Error>>
```

Return the next notification or terminal error, then `None`.

Once `None` is returned, subsequent calls also return `None`. See
[`ControlEvents`] for the EOF and cleanup contract.

# Errors

Yields one terminal error for transport failure, unexpected EOF, a
frame budget or command deadline being exceeded, executor shutdown,
or failed connection cleanup. A panic in the connection task resumes
here instead, since nothing else would report it.

# Cancel safety

Nothing happened: a dropped call consumes neither an event nor the
terminal error.
