泛型中的+符号是什么?

问题描述 投票:0回答:1

我已经在锈语言书的第19章上了,所以我看到了这段代码

Box<dyn Fn() + Send + 'static>

它做什么,为什么里面有加号?我不记得我在上一章中遇到过。

以及Box::new(|| println!("hi"))如何是Box<dyn Fn() + Send + 'static>

谢谢

generics rust
1个回答
0
投票

感谢@Asya Corbeau使我回到了第10章,它是Specifying Multiple Trait Bounds with the + Syntax

© www.soinside.com 2019 - 2024. All rights reserved.