Trait rawpointer::PointerExt [−][src]
Extension methods for raw pointers
Required methods
Loading content...Provided methods
unsafe fn add(self, i: usize) -> Self
[src]
unsafe fn sub(self, i: usize) -> Self
[src]
unsafe fn pre_inc(&mut self) -> Self
[src]
Increment the pointer by 1, and return its new value.
Equivalent to the C idiom ++ptr
.
unsafe fn post_inc(&mut self) -> Self
[src]
Increment the pointer by 1, but return its old value.
Equivalent to the C idiom ptr++
.
unsafe fn pre_dec(&mut self) -> Self
[src]
Decrement the pointer by 1, and return its new value.
Equivalent to the C idiom --ptr
.
unsafe fn post_dec(&mut self) -> Self
[src]
Decrement the pointer by 1, but return its old value.
Equivalent to the C idiom ptr--
.
unsafe fn inc(&mut self)
[src]
Increment by 1
unsafe fn dec(&mut self)
[src]
Decrement by 1
unsafe fn stride_offset(self, s: isize, index: usize) -> Self
[src]
Offset the pointer by s
multiplied by index
.
Implementations on Foreign Types
impl<T> PointerExt for NonNull<T>
[src]
NonNull<T>
supports the same offsetting methods under the same
safety constraints as the other raw pointer implementations.
There is no difference - both when offsetting *mut T
and NonNull<T>
,
the offset is only well defined if we remain inside the same object or
one-past the end, and we can never land in a null pointer while obeying
those rules.