aboutsummaryrefslogtreecommitdiff
path: root/src/peering/basalt.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-07-21 20:22:56 +0200
committerAlex Auvolat <alex@adnab.me>2022-07-21 20:22:56 +0200
commit4934ed726d51913afd97ca937d0ece39ef8b7371 (patch)
treead9560d819bfcbab9e35ee806bd9b2adaa8f9de5 /src/peering/basalt.rs
parent7d148c7e764d563efa3bccc0f14f50867db38ef1 (diff)
downloadnetapp-4934ed726d51913afd97ca937d0ece39ef8b7371.tar.gz
netapp-4934ed726d51913afd97ca937d0ece39ef8b7371.zip
Propose alternative API
Diffstat (limited to 'src/peering/basalt.rs')
-rw-r--r--src/peering/basalt.rs17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/peering/basalt.rs b/src/peering/basalt.rs
index d7bc6a8..71dea84 100644
--- a/src/peering/basalt.rs
+++ b/src/peering/basalt.rs
@@ -468,15 +468,24 @@ impl Basalt {
#[async_trait]
impl EndpointHandler<PullMessage> for Basalt {
- async fn handle(self: &Arc<Self>, _pullmsg: PullMessage, _from: NodeID) -> PushMessage {
- self.make_push_message()
+ async fn handle(
+ self: &Arc<Self>,
+ _pullmsg: Req<PullMessage>,
+ _from: NodeID,
+ ) -> Resp<PullMessage> {
+ Resp::new(self.make_push_message())
}
}
#[async_trait]
impl EndpointHandler<PushMessage> for Basalt {
- async fn handle(self: &Arc<Self>, pushmsg: PushMessage, _from: NodeID) {
- self.handle_peer_list(&pushmsg.peers[..]);
+ async fn handle(
+ self: &Arc<Self>,
+ pushmsg: Req<PushMessage>,
+ _from: NodeID,
+ ) -> Resp<PushMessage> {
+ self.handle_peer_list(&pushmsg.msg().peers[..]);
+ Resp::new(())
}
}