Sets the size of this reservation to `capacity`
(&self, capacity: usize)
| 438 | |
| 439 | /// Sets the size of this reservation to `capacity` |
| 440 | pub fn resize(&self, capacity: usize) { |
| 441 | let size = self.size.load(atomic::Ordering::Relaxed); |
| 442 | match capacity.cmp(&size) { |
| 443 | Ordering::Greater => self.grow(capacity - size), |
| 444 | Ordering::Less => self.shrink(size - capacity), |
| 445 | _ => {} |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | /// Try to set the size of this reservation to `capacity` |
| 450 | pub fn try_resize(&self, capacity: usize) -> Result<()> { |
no test coverage detected