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 } } 例項化泛型