Skip to main content

ptrait/
raw.rs

1use crate::{Ptr, PtrMut, RawMutPtr, RawPtr};
2
3impl<T: ?Sized> Ptr for *const T {
4    type Target = T;
5
6    #[inline]
7    fn as_ptr(&self) -> *const T {
8        *self
9    }
10}
11
12impl<T: ?Sized> RawPtr for *const T {}
13
14impl<T: ?Sized> Ptr for *mut T {
15    type Target = T;
16
17    #[inline]
18    fn as_ptr(&self) -> *const T {
19        *self
20    }
21}
22impl<T: ?Sized> PtrMut for *mut T {
23    #[inline]
24    fn as_mut_ptr(&mut self) -> *mut T {
25        *self
26    }
27}
28
29impl<T: ?Sized> RawPtr for *mut T {}
30impl<T: ?Sized> RawMutPtr for *mut T {}