It makes sense for smart pointers like Box<T>
, Rc<T>
, Arc<T>
. And actually yes, Deref
is also implemented for &T
and &mut T
and it does dereference in that case.
But what about String
and Vec<T>
? Are those smart pointers or "pointer-like"? To me it's a stretch to call them that. They do store a pointer, but it seems like an implementation detail rather than the essence of what they represent.
And then what about ArrayVec<T>
, ArrayString
, ManuallyDrop<T>
? Those don't even store a pointer, they are quite clearly not "pointers". And they implement Deref
.
That's why I say it is a more general "unwrap" / "coerce" operation that is used implicitly in certain situations, rather than specifically "dereferencing".