aboutsummaryrefslogtreecommitdiff
path: root/src/netapp.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-07-22 10:55:37 +0200
committerAlex Auvolat <alex@adnab.me>2022-07-22 10:55:37 +0200
commitc358fe3c92da8a8454e461484737efe2a14dfd73 (patch)
treedb540e2e25a96585686826ef66f3552decee96df /src/netapp.rs
parent4934ed726d51913afd97ca937d0ece39ef8b7371 (diff)
downloadnetapp-c358fe3c92da8a8454e461484737efe2a14dfd73.tar.gz
netapp-c358fe3c92da8a8454e461484737efe2a14dfd73.zip
Hide streaming versions as much as possible
Diffstat (limited to 'src/netapp.rs')
-rw-r--r--src/netapp.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/netapp.rs b/src/netapp.rs
index 0cebac0..166f560 100644
--- a/src/netapp.rs
+++ b/src/netapp.rs
@@ -152,7 +152,7 @@ impl NetApp {
pub fn endpoint<M, H>(self: &Arc<Self>, path: String) -> Arc<Endpoint<M, H>>
where
M: Message + 'static,
- H: EndpointHandler<M> + 'static,
+ H: StreamingEndpointHandler<M> + 'static,
{
let endpoint = Arc::new(Endpoint::<M, H>::new(self.clone(), path.clone()));
let endpoint_arc = EndpointArc(endpoint.clone());
@@ -433,8 +433,7 @@ impl NetApp {
#[async_trait]
impl EndpointHandler<HelloMessage> for NetApp {
- async fn handle(self: &Arc<Self>, msg: Req<HelloMessage>, from: NodeID) -> Resp<HelloMessage> {
- let msg = msg.msg();
+ async fn handle(self: &Arc<Self>, msg: &HelloMessage, from: NodeID) {
debug!("Hello from {:?}: {:?}", hex::encode(&from[..8]), msg);
if let Some(h) = self.on_connected_handler.load().as_ref() {
if let Some(c) = self.server_conns.read().unwrap().get(&from) {
@@ -443,6 +442,5 @@ impl EndpointHandler<HelloMessage> for NetApp {
h(from, remote_addr, true);
}
}
- Resp::new(())
}
}