A Rust bound such as T: Display lets a generic function use behavior promised by the trait. Callers can pass only types that implement that trait.
The demo’s format function requires Display. String passes, while a hypothetical Photo without a Display implementation is rejected. The bound names a capability without fixing the function to one concrete type.
When to use
Use trait bounds in generic APIs that accept many types but require behavior such as formatting or comparison.