This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Answer the following questions to demonstrate what you've learned:
When are Rust traits useful?
When a function or struct needs to accept optional parameters.
When we need to specify function or struct parameters in terms of behavior rather than concrete value.
When we need to avoid the compile-time guarantees of the Borrow Checker.
When we need our values to continue to be valid beyond their lifetime scope.
What does the following function signature mean? fn show_on_screen<T: Display>(data: T)
fn show_on_screen<T: Display>(data: T)
The data parameter can be of any type.
data
The data parameter can be of any type that optionally implements the Display trait.
Display
The data parameter is restricted only to types that implement the Display trait.
The data parameter is optional.
You must answer all questions before checking your work.
Continue
Was this page helpful?