R

Ravina • 3.96K Points
Extraordinary

Q. What is the purpose of the `dyn` keyword in Rust?

  • (A) Defines a dynamic variable
  • (B) Specifies a trait object
  • (C) Creates a macro
  • (D) Marks a function as dynamic
  • Correct Answer - Option(B)
  • Views: 11
  • Filed under category Rust
  • Hashtags:

Explanation by: Ravina
`dyn` is used to specify a trait object for dynamic dispatch.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.