Fn*
trait bound it encounters.Fn
bound of the type parameter.Fn*
depending on how you call it. Only first call counts.Fn*
trait (except HKLB).
Fn*
trait for generic argument is the same as implement multiple Fn*
traits for different argument types - closure can't do it either.
Hello, I need some help here solving a problem with closures. I have this:
let mut varegrupper: Vec<Varegruppe> = vec![];
let future = SqlConnection::connect(conn_str).and_then(|conn| {
conn
.simple_query("SELECT * from nxDw.dbo.Varegr")
.for_each(|row: QueryRow| {
let r1: &str = row.get(0);
let r2: &str = row.get(1);
let r3: &str = row.get(2);
&varegrupper.push(Varegruppe::new(r1, r2, r3));
Ok(())
})
});
match current_thread::block_on_all(future) {
Ok(_) => Ok(varegrupper),
Err(e) => Err(e),
}
}
And i get a cannot move out of
varegrupperbecause it is borrowed
error. I know how that works, but I see no way of solving it...
futures
goes out of scope before the final match...