tufa 0.1.0

A wgpu abstraction layer.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub struct ThreadSafePtr<T>(pub *mut T);

unsafe impl<T> Send for ThreadSafePtr<T> {}
unsafe impl<T> Sync for ThreadSafePtr<T> {}

impl<T> ThreadSafePtr<T> {
    pub fn deref(&self) -> &'static T {
        unsafe { &*self.0 }
    }

    pub fn deref_mut(self) -> &'static mut T {
        unsafe { &mut *self.0 }
    }
}