@@ -210,7 +210,7 @@ pub trait BoxableConnection<In: RpcMessage, Out: RpcMessage>:
210210 fn clone_box ( & self ) -> Box < dyn BoxableConnection < In , Out > > ;
211211
212212 /// Open a channel to the remote che
213- fn open_bi_boxed ( & self ) -> OpenFuture < In , Out > ;
213+ fn open_boxed ( & self ) -> OpenFuture < In , Out > ;
214214}
215215
216216/// A boxed connection
@@ -242,8 +242,8 @@ impl<S: Service> ConnectionErrors for Connection<S> {
242242}
243243
244244impl < S : Service > super :: Connection < S :: Res , S :: Req > for Connection < S > {
245- async fn open_bi ( & self ) -> Result < ( Self :: SendSink , Self :: RecvStream ) , Self :: OpenError > {
246- self . 0 . open_bi_boxed ( ) . await
245+ async fn open ( & self ) -> Result < ( Self :: SendSink , Self :: RecvStream ) , Self :: OpenError > {
246+ self . 0 . open_boxed ( ) . await
247247 }
248248}
249249
@@ -290,7 +290,7 @@ impl<In: RpcMessage, Out: RpcMessage> ConnectionErrors for ServerEndpoint<In, Ou
290290}
291291
292292impl < In : RpcMessage , Out : RpcMessage > super :: ServerEndpoint < In , Out > for ServerEndpoint < In , Out > {
293- fn accept_bi (
293+ fn accept (
294294 & self ,
295295 ) -> impl Future < Output = Result < ( Self :: SendSink , Self :: RecvStream ) , Self :: OpenError > > + Send
296296 {
@@ -308,9 +308,9 @@ impl<S: Service> BoxableConnection<S::Res, S::Req> for super::quinn::QuinnConnec
308308 Box :: new ( self . clone ( ) )
309309 }
310310
311- fn open_bi_boxed ( & self ) -> OpenFuture < S :: Res , S :: Req > {
311+ fn open_boxed ( & self ) -> OpenFuture < S :: Res , S :: Req > {
312312 let f = Box :: pin ( async move {
313- let ( send, recv) = super :: Connection :: open_bi ( self ) . await ?;
313+ let ( send, recv) = super :: Connection :: open ( self ) . await ?;
314314 // map the error types to anyhow
315315 let send = send. sink_map_err ( anyhow:: Error :: from) ;
316316 let recv = recv. map_err ( anyhow:: Error :: from) ;
@@ -329,7 +329,7 @@ impl<S: Service> BoxableServerEndpoint<S::Req, S::Res> for super::quinn::QuinnSe
329329
330330 fn accept_bi_boxed ( & self ) -> AcceptFuture < S :: Req , S :: Res > {
331331 let f = async move {
332- let ( send, recv) = super :: ServerEndpoint :: accept_bi ( self ) . await ?;
332+ let ( send, recv) = super :: ServerEndpoint :: accept ( self ) . await ?;
333333 let send = send. sink_map_err ( anyhow:: Error :: from) ;
334334 let recv = recv. map_err ( anyhow:: Error :: from) ;
335335 anyhow:: Ok ( ( SendSink :: boxed ( send) , RecvStream :: boxed ( recv) ) )
@@ -348,8 +348,8 @@ impl<S: Service> BoxableConnection<S::Res, S::Req> for super::flume::FlumeConnec
348348 Box :: new ( self . clone ( ) )
349349 }
350350
351- fn open_bi_boxed ( & self ) -> OpenFuture < S :: Res , S :: Req > {
352- OpenFuture :: direct ( super :: Connection :: open_bi ( self ) )
351+ fn open_boxed ( & self ) -> OpenFuture < S :: Res , S :: Req > {
352+ OpenFuture :: direct ( super :: Connection :: open ( self ) )
353353 }
354354}
355355
@@ -360,7 +360,7 @@ impl<S: Service> BoxableServerEndpoint<S::Req, S::Res> for super::flume::FlumeSe
360360 }
361361
362362 fn accept_bi_boxed ( & self ) -> AcceptFuture < S :: Req , S :: Res > {
363- AcceptFuture :: direct ( super :: ServerEndpoint :: accept_bi ( self ) )
363+ AcceptFuture :: direct ( super :: ServerEndpoint :: accept ( self ) )
364364 }
365365
366366 fn local_addr ( & self ) -> & [ super :: LocalAddr ] {
@@ -393,14 +393,14 @@ mod tests {
393393 let client = super :: Connection :: < FooService > :: new ( client) ;
394394 // spawn echo server
395395 tokio:: spawn ( async move {
396- while let Ok ( ( mut send, mut recv) ) = server. accept_bi ( ) . await {
396+ while let Ok ( ( mut send, mut recv) ) = server. accept ( ) . await {
397397 if let Some ( Ok ( msg) ) = recv. next ( ) . await {
398398 send. send ( msg) . await . ok ( ) ;
399399 }
400400 }
401401 anyhow:: Ok ( ( ) )
402402 } ) ;
403- if let Ok ( ( mut send, mut recv) ) = client. open_bi ( ) . await {
403+ if let Ok ( ( mut send, mut recv) ) = client. open ( ) . await {
404404 send. send ( 1 ) . await . ok ( ) ;
405405 let res = recv. next ( ) . await ;
406406 println ! ( "{:?}" , res) ;
0 commit comments