Struct phantom_type::PhantomType
source · pub struct PhantomType<T: ?Sized>(/* private fields */);
Expand description
A PhantomData
analog which prevents “parameter is never used” error,
but does not produce any restrictions in contrast with PhantomData
.
Implementations§
Trait Implementations§
source§impl<T: ?Sized> Clone for PhantomType<T>where
PhantomData<T>: Copy,
impl<T: ?Sized> Clone for PhantomType<T>where
PhantomData<T>: Copy,
source§impl<T: ?Sized> Debug for PhantomType<T>where
PhantomData<T>: Debug,
impl<T: ?Sized> Debug for PhantomType<T>where
PhantomData<T>: Debug,
source§impl<T: ?Sized> Default for PhantomType<T>where
PhantomData<T>: Default,
impl<T: ?Sized> Default for PhantomType<T>where
PhantomData<T>: Default,
source§impl<T: ?Sized> Hash for PhantomType<T>where
PhantomData<T>: Hash,
impl<T: ?Sized> Hash for PhantomType<T>where
PhantomData<T>: Hash,
source§impl<T: ?Sized> Ord for PhantomType<T>
impl<T: ?Sized> Ord for PhantomType<T>
source§impl<T: ?Sized> PartialEq for PhantomType<T>where
PhantomData<T>: PartialEq,
impl<T: ?Sized> PartialEq for PhantomType<T>where
PhantomData<T>: PartialEq,
source§impl<T: ?Sized> PartialOrd for PhantomType<T>
impl<T: ?Sized> PartialOrd for PhantomType<T>
impl<T: ?Sized> Copy for PhantomType<T>where
PhantomData<T>: Copy,
impl<T: ?Sized> Eq for PhantomType<T>where
PhantomData<T>: PartialEq,
impl<T: ?Sized> RefUnwindSafe for PhantomType<T>
impl<T: ?Sized> Send for PhantomType<T>
impl<T: ?Sized> Sync for PhantomType<T>
impl<T: ?Sized> Unpin for PhantomType<T>
impl<T: ?Sized> UnwindSafe for PhantomType<T>
Auto Trait Implementations§
impl<T> Freeze for PhantomType<T>where
T: ?Sized,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)