What are blanket implementations

It is an implement of a trait either for all types, or for all types that match some condition. For example, the stdandard library has this impl:

impl<T> ToString for T
where
    T: Display + ?Sized,
{ ... }

It is a blanket impl that implements ToString for all types that implement the Display trait.

18 Likes