(value: bytes::Bytes)
| 233 | |
| 234 | impl From<bytes::Bytes> for Bytes { |
| 235 | fn from(value: bytes::Bytes) -> Self { |
| 236 | let len = value.len(); |
| 237 | Self { |
| 238 | len, |
| 239 | ptr: NonNull::new(value.as_ptr() as _).unwrap(), |
| 240 | deallocation: Deallocation::Custom(std::sync::Arc::new(value), len), |
| 241 | #[cfg(feature = "pool")] |
| 242 | reservation: Mutex::new(None), |
| 243 | } |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | #[cfg(test)] |