[英]cannot infer an appropriate lifetime for lifetime parameter '_ in function call due to conflicting requirements
i have a vector of a struct我有一个结构的向量
let list = vec![
ListenerList {
listener: Pattern {
cmd: "sum"
},
handler: |listener, connection| Box::pin(simple_handler(listener, connection))
}
];
The problem is in the definition of the handler<\/code> field of
ListenerList<\/code> , which has this type:
问题出在
ListenerList<\/code>的
handler<\/code>字段的定义中,它具有以下类型:
fn(Subscription, &Connection) -> Pin<Box<dyn futures::Future<Output = ()>>>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.