Summary

Okay, so we have three different ways to approach the same problem, each with different strengths and weaknesses:

  • We learned that enumerations are the most efficient, especially for simple cases
  • We learned that trait object references produce the simplest code, at the cost of additional overhead
  • We learned that the Any trait gives us a way to refer to almost anything, but we have to explicitly extract the type of information we need

In the next chapter, we're going to learn how to store data outside the stack, and why we would want to.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.49.247