采用泛型枚举或可以在函数中“按需使用”的任何类型

我不知道答案是什么,这就是标题如此含糊的原因。

像这样,在锈中将枚举类型转换为数字是可能的

enum ExampleEnum { A, B, C }

fn main() {
    println!("{}", ExampleEnum::B as usize);
}

有没有一种方法可以使泛型函数采用任何可以做到这一点的数据类型?还是一些封装了该功能的特性?也许是以“不安全”的方式(转换?)?

enum ExampleEnum { A, B, C }

fn what_n(x: ???) -> usize {
    x as usize
}

fn main() {
    println!("{}", what_n(ExampleEnum::B));
}