1use std::marker::PhantomData;
2use std::ops::Deref;
3
4pub struct Unique<T> {
5 contents: *mut T,
6 _marker: PhantomData<T>,
7}
8
9impl<T> Deref for Unique<T> {
10 type Target = *mut T;
11 fn deref(&self) -> &Self::Target {
12 &self.contents
13 }
14}
15
16impl<T> Unique<T> {
17 pub unsafe fn new(ptr: *mut T) -> Self {
18 Unique {
19 contents: ptr,
20 _marker: PhantomData,
21 }
22 }
23}
24