(&self)
| 104 | } |
| 105 | |
| 106 | pub fn capacity(&self) -> usize { |
| 107 | match self.deallocation { |
| 108 | Deallocation::Standard(layout) => layout.size(), |
| 109 | // we only know the size of the custom allocation |
| 110 | // its underlying capacity might be larger |
| 111 | Deallocation::Custom(_, size) => size, |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | /// Register this [`Bytes`] with the provided [`MemoryPool`], replacing any prior reservation. |
| 116 | #[cfg(feature = "pool")] |
no test coverage detected