Calculates the offset from a pointer using wrapping arithmetic. (convenience for `.wrapping_offset((count as isize).wrapping_sub())`) `count` is in units of T; e.g. a `count` of 3 represents a pointer offset of `3 * size_of:: ()` bytes. # Safety The resulting pointer does not need to be in bounds, but it is potentially hazardous to dereference (which requires `unsafe`). Always use `.sub(coun
(self, count: usize)
| 319 | /// } |
| 320 | /// ``` |
| 321 | pub fn wrapping_sub(self, count: usize) -> Self |
| 322 | where |
| 323 | T: Sized, |
| 324 | { |
| 325 | self.wrapping_offset((count as isize).wrapping_neg()) |
| 326 | } |
| 327 | |
| 328 | /// Casts this device pointer to another type. |
| 329 | pub fn cast<U: DeviceCopy>(self) -> DevicePointer<U> { |
no test coverage detected