A dummy type for unused type parameters.
struct PhantomData<T>
where T: ?Sized,| Name | Description |
|---|---|
| Clone | Objects that can be duplicated. |
| Copy | Objects that can safely be copied via |
| Eq | Objects that implement the binary |
Normally, all type parameters have to be used in some way. If a type has type parameters that are not used directly in the type definition, it has to use this object instead:
struct X<T> {
_dummy: PhantomData<T>,
}