mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-01-08 00:43:10 +00:00
use of Option in StoreWakuMessageResponse for responses with or withoug msgs
This commit is contained in:
parent
bbcf401699
commit
f1e4e024d5
@ -152,10 +152,13 @@ impl App<Running> {
|
|||||||
Some(time_start),
|
Some(time_start),
|
||||||
None,
|
None,
|
||||||
None).await.unwrap();
|
None).await.unwrap();
|
||||||
|
|
||||||
let messages: Vec<_> = messages
|
let messages: Vec<_> = messages
|
||||||
.iter()
|
.into_iter()
|
||||||
|
// we expect messages because the query was passed with include_data == true
|
||||||
|
.filter(|item| item.message.is_some())
|
||||||
.map(|store_resp_msg| {
|
.map(|store_resp_msg| {
|
||||||
<Chat2Message as Message>::decode(store_resp_msg.message.payload())
|
<Chat2Message as Message>::decode(store_resp_msg.message.unwrap().payload())
|
||||||
.expect("Toy chat messages should be decodeable")
|
.expect("Toy chat messages should be decodeable")
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|||||||
@ -109,7 +109,7 @@ impl StoreQueryRequest {
|
|||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct StoreWakuMessageResponse {
|
pub struct StoreWakuMessageResponse {
|
||||||
pub message_hash: MessageHash,
|
pub message_hash: MessageHash,
|
||||||
pub message: WakuStoreRespMessage,
|
pub message: Option<WakuStoreRespMessage>, // None if include_data == false
|
||||||
pub pubsub_topic: String,
|
pub pubsub_topic: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user