StackOverflow 文档 Rust 教程 泛型 声明 声明 Created: November-22, 2018 // Generic types are declared using the <T> annotation struct GenericType<T> { pub item: T } enum QualityChecked<T> { Excellent(T), Good(T), // enum fields can be generics too Mediocre { product: T } } 实例化泛型