October 2019
Intermediate to advanced
444 pages
10h 37m
English
Rust's function overloading is a bit more exotic than in other languages. Instead of redefining the same function with a different type signature, you can achieve the same result by specifying the actual types for a generic implementation. Generics are a great way to provide more general interfaces and are not too complex to implement thanks to helpful compiler messages.
In this recipe, we are going to implement a dynamic array (such as Vec<T>) in a generic way.
Read now
Unlock full access