diff options
author | Alex Auvolat <alex@adnab.me> | 2022-07-22 14:45:28 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-07-22 14:45:28 +0200 |
commit | cbc21e40acfc420a3e452a1fd488c6a96694b0f2 (patch) | |
tree | 99ba78dc0786f453056aa74e9a867969b96cc064 /src/endpoint.rs | |
parent | 482566929385fab18300d205a89d0e23d977855b (diff) | |
download | netapp-cbc21e40acfc420a3e452a1fd488c6a96694b0f2.tar.gz netapp-cbc21e40acfc420a3e452a1fd488c6a96694b0f2.zip |
Impose static lifetime on message and response
Diffstat (limited to 'src/endpoint.rs')
-rw-r--r-- | src/endpoint.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/endpoint.rs b/src/endpoint.rs index a402fec..bb768de 100644 --- a/src/endpoint.rs +++ b/src/endpoint.rs @@ -27,7 +27,7 @@ where /// use the unit type `()` as the handler type: /// it will panic if it is ever made to handle request. #[async_trait] -impl<M: Message + 'static> EndpointHandler<M> for () { +impl<M: Message> EndpointHandler<M> for () { async fn handle(self: &Arc<()>, _m: &M, _from: NodeID) -> M::Response { panic!("This endpoint should not have a local handler."); } @@ -50,7 +50,7 @@ where impl<T, M> StreamingEndpointHandler<M> for T where T: EndpointHandler<M>, - M: Message + 'static, + M: Message, { async fn handle(self: &Arc<Self>, mut m: Req<M>, from: NodeID) -> Resp<M> { // Immediately drop stream to avoid backpressure if a stream was sent @@ -177,7 +177,7 @@ where #[async_trait] impl<M, H> GenericEndpoint for EndpointArc<M, H> where - M: Message + 'static, + M: Message, H: StreamingEndpointHandler<M> + 'static, { async fn handle(&self, req_enc: ReqEnc, from: NodeID) -> Result<RespEnc, Error> { |