我怎样才能创建一个接受任何类型的函数?

How can I create a function which accepts any type?

我如何在 Rust 中创建一个接受任何类型或多个类型作为函数参数的函数?

我的第一个方法:

fn multiple_types(argument : _) {
    println!("{}",argument);
}

我尝试将类型占位符“_”作为参数,但这是不允许的...

来自the documentation

We can write functions that take generic types with a similar syntax:

fn takes_anything<T>(x: T) {
    // do something with x
}