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>
Available on crate feature
std only.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>
Available on crate feature
std only.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