# limits.OutputLimits

- **Module:** limits
- **Package:** libtmux
- **Language:** Rust
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/limits.rs#L35
- **Page:** https://libtmux.org/en/rs/latest/reference/limits-outputlimits/

How many bytes one dispatch may read from each stream.

Exceeding a budget fails the dispatch with
[`Error::OutputLimitExceeded`](crate::Error::OutputLimitExceeded) rather
than truncating, because a truncated tmux listing is a shorter listing: it
decodes cleanly and says something false. A caller who wants the first N
bytes of a pane asks tmux for them.

## Example

```rust
use libtmux::OutputLimits;

// The default is roomy enough for a pane with a very long history.
assert_eq!(OutputLimits::default().stdout_bytes(), 32 * 1024 * 1024);

// Tighten it where the caller knows the answer is small.
let limits = OutputLimits::default().max_stdout_bytes(64 * 1024);
assert_eq!(limits.stdout_bytes(), 64 * 1024);
```

## Members

- `DEFAULT_STDOUT_BYTES` (constant): 32 MiB of stdout, which is more history than a pane usually holds.
- `DEFAULT_STDERR_BYTES` (constant): 1 MiB of stderr. tmux's errors are one line; anything approaching this is a runaway rather than a message.
- `max_stdout_bytes` (method): Set the stdout budget for one dispatch.
- `max_stderr_bytes` (method): Set the stderr budget for one dispatch.
- `stdout_bytes` (method): The stdout budget for one dispatch.
- `stderr_bytes` (method): The stderr budget for one dispatch.
