(&self, max_capacity: usize, cleanup_age: Duration)
| 116 | } |
| 117 | |
| 118 | fn should_discard(&self, max_capacity: usize, cleanup_age: Duration) -> bool { |
| 119 | // Discard if buffer has grown too large or is too old |
| 120 | self.buffer.capacity() > max_capacity || |
| 121 | self.last_used.elapsed() > cleanup_age |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | /// Thread-safe buffer pool for reusing BytesMut instances |
no test coverage detected