如何重载Rust中自定义类型的调用运算符?

时间:2019-03-27 18:13:38

标签: rust operator-overloading traits

如何为此自定义类型重载调用运算符:

type Task = Box<dyn FnBox + Send + 'static>;

所以我可以做task(),它将调用box内的函数。

0 个答案:

没有答案