How to Use the Blanket Implementation Pattern

Implement a trait for all types satisfying a specific bound using a generic `impl<T: TraitBound>` block.

The Blanket Implementation Pattern is not a standard Rust term; you are likely looking for how to implement a trait for all types that satisfy a specific bound using generics. Define a trait with a generic parameter constrained by a trait bound, then implement it for that generic type.

trait MyTrait {
    fn my_method(&self);
}

impl<T: Display> MyTrait for T {
    fn my_method(&self) {
        println!("{}", self);
    }
}

This code implements MyTrait for any type T that also implements Display, allowing you to call my_method on strings, numbers, or any other type that can be printed.