Summary

In this chapter, we have done the following:

  • Looked at generic type parameters for data types and for functions
  • Learned how to limit generic type parameters so that we can be sure the concrete types chosen implement the proper traits
  • Seen various compiler errors relating to generic types, and what they mean
  • Learned how to use trait bounds and the Fn, FnMut, and FnOnce traits to create higher-order functions
  • Learned about the differences and similarities between using generic types and using trait objects
  • Taken our knowledge from this chapter and previous chapters and built a binary tree data structure

In the next chapter, we're going to conclude our Rust journey by looking at many more traits, learning what they mean and how to implement them.

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

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