Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deserialize in to struct? #1

Open
measproem opened this issue Jan 28, 2023 · 0 comments
Open

How to deserialize in to struct? #1

measproem opened this issue Jan 28, 2023 · 0 comments

Comments

@measproem
Copy link

I am new, may you provide sample code deserialize responsed result in to struct, my belove code:

#[derive(Debug, Deserialize, PartialEq, Serialize)]
pub struct UserInfo{
id: Uuid,//UUID
user_id   : i64,
first_name: String,
last_name : String,
user_name : String,
email     : String,
status    : bool,
}

#[derive(Debug, Deserialize, PartialEq, Serialize)]
pub struct UserResponse {
    pub users: Vec<UserInfo>,
}
-------- quick  pseudo code ---
let responfromtarantool  = ....calltotarantoo()
match responfromtarantool .wait {
  Ok(res) => Ok({
      UserResponse {
          users = res /// Here is problem I want you help
      }
  })

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant