You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let sql = "select id, username from t_user where id < ?";letmut stream = sqlx::query(sql).bind(3_i32).map::<_,User>(|row:MySqlRow| {Ok(User{id: row.get("id"),username: row.get("username"),})}).fetch(&pool);whileletSome(user) = stream.next().await? {println!("{:?}", user);}
error[E0277]: the trait bound `[closure@src\main.rs:36:24: 41:10]: sqlx_core::query::MapRow<sqlx_core::mysql::database::MySql>` is not satisfied
--> src\main.rs:36:9
|
36 | map::<_, User>(|row: MySqlRow| {
| ^^^ the trait `sqlx_core::query::MapRow<sqlx_core::mysql::database::MySql>` is not implemented for `[closure@src\main.rs:36:24: 41:10]`
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: