api: updated returned message specifiers
This commit is contained in:
parent
3535da9a39
commit
388c26fdc8
2 changed files with 3 additions and 2 deletions
|
@ -81,6 +81,6 @@ fn main() {
|
||||||
let msg = socket.read_message().expect("Error reading message");
|
let msg = socket.read_message().expect("Error reading message");
|
||||||
let resp: message_types::ServerResponse =
|
let resp: message_types::ServerResponse =
|
||||||
serde_json::from_str(msg.into_text().unwrap().as_str()).unwrap();
|
serde_json::from_str(msg.into_text().unwrap().as_str()).unwrap();
|
||||||
println!("recieved: {:?}", resp);
|
println!("recieved: {:?}\n{:?}", resp.message, resp.search_results);
|
||||||
socket.close(None).unwrap();
|
socket.close(None).unwrap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,8 +73,9 @@ impl PartialTag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct ServerResponse {
|
pub struct ServerResponse {
|
||||||
|
pub message: String,
|
||||||
pub search_results: Vec<ItemTag>,
|
pub search_results: Vec<ItemTag>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue