pub struct SendPtr<T> {
ptr: *mut T,
}
unsafe impl<T> Send for SendPtr<T> {}
unsafe impl<T> Sync for SendPtr<T> {}
impl<T> Copy for SendPtr<T> {}
impl<T> Clone for SendPtr<T> {
fn clone(&self) -> Self {
*self
}
}
impl<T> SendPtr<T> {
pub fn new(ptr: *mut T) -> Self {
Self { ptr }
}
pub unsafe fn get(self) -> *mut T {
self.ptr
}
}
pub struct SendConstPtr<T> {
ptr: *const T,
}
unsafe impl<T> Send for SendConstPtr<T> {}
unsafe impl<T> Sync for SendConstPtr<T> {}
impl<T> Copy for SendConstPtr<T> {}
impl<T> Clone for SendConstPtr<T> {
fn clone(&self) -> Self {
*self
}
}
impl<T> SendConstPtr<T> {
pub fn new(ptr: *const T) -> Self {
Self { ptr }
}
pub unsafe fn get(self) -> *const T {
self.ptr
}
}