ptrait 0.1.0

A small crate providing traits for pointer-like types, such as references and smart pointers.
Documentation
use crate::{Ptr, PtrMut, RawMutPtr, RawPtr};

impl<T: ?Sized> Ptr for *const T {
    type Target = T;

    #[inline]
    fn as_ptr(&self) -> *const T {
        *self
    }
}

impl<T: ?Sized> RawPtr for *const T {}

impl<T: ?Sized> Ptr for *mut T {
    type Target = T;

    #[inline]
    fn as_ptr(&self) -> *const T {
        *self
    }
}
impl<T: ?Sized> PtrMut for *mut T {
    #[inline]
    fn as_mut_ptr(&mut self) -> *mut T {
        *self
    }
}

impl<T: ?Sized> RawPtr for *mut T {}
impl<T: ?Sized> RawMutPtr for *mut T {}