这个SO answer使用我不熟悉的 where
语法:
fn readfile<'a, T: ?Sized>(filename: &str) -> Result<Box<Outer<'a, T>>, Box<std::error::Error>>
where
for<'de> T: Deserialize<'de> + 'a
{
...
for
是什么意思?
这是在哪里记录的?
最佳答案
这就是所谓的higher-ranked trait bounds :
for<'a> can be read as "for all choices of 'a"
它由 Rust RFC 0387 定义.
关于rust - "where for"在 Rust 中意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57647276/