Override the per-read size ceiling. Passing `0` falls back to [`DEFAULT_MAX_READ_BYTES`] — a zero ceiling would make every read fail and is treated as a configuration mistake.
(mut self, bytes: u64)
| 310 | /// [`DEFAULT_MAX_READ_BYTES`] — a zero ceiling would make every read |
| 311 | /// fail and is treated as a configuration mistake. |
| 312 | pub fn with_max_read_bytes(mut self, bytes: u64) -> Self { |
| 313 | self.max_read_bytes = if bytes == 0 { |
| 314 | DEFAULT_MAX_READ_BYTES |
| 315 | } else { |
| 316 | bytes |
| 317 | }; |
| 318 | self |
| 319 | } |
| 320 | |
| 321 | /// Active per-read size ceiling in bytes. |
| 322 | pub fn max_read_bytes(&self) -> u64 { |