泛型概览
泛型实现方式
阅读这张图的内容,可以理出不少设计。
比如trait object和trait bound其实从一开始就是不同路线的解决方案
泛型就像定义函数
Define
Usage
Function
Extract args from **duplicate code**, to make it more universal
Get **different results** via different args when calling functions
Generics
Extract args from **duplicate data structure**, to make it more universal
Get **different specific data structures** via different args when using generics