async fn new_protocols_for_connection(
        &mut self,
        stream: TcpStream,
    ) -> crate::Result<(Box<dyn TAsyncInputProtocol + Send>, Box<dyn TAsyncOutputProtocol + Send>)> {
        // create the shared tcp stream
        let channel = TAsyncTcpChannel::with_stream(stream);

        // split it into two - one to be owned by the
        // input tran/proto and the other by the output
        let (r_chan, w_chan) = channel.split()?;

        // input protocol and transport
        let r_tran = self.r_trans_factory.create(Box::new(r_chan));
        let i_prot = self.i_proto_factory.create(r_tran);

        // output protocol and transport
        let w_tran = self.w_trans_factory.create(Box::new(w_chan));
        let o_prot = self.o_proto_factory.create(w_tran);

        Ok((i_prot, o_prot))
    }
/// build io channel for connection
/// return input channel and output channel
build io channel for connection
return input channel and output channel
build io channel for connection return input channel and output channel
async fn new_protocols_for_connection(
        &mut self,
        stream: TcpStream,
    ) -> crate::Result<(Box<dyn TAsyncInputProtocol + Send>, Box<dyn TAsyncOutputProtocol + Send>)> {
        // create the shared tcp stream
        let channel = TAsyncTcpChannel::with_stream(stream);
        // split it into two - one to be owned by the
        // input tran/proto and the other by the output
        let (r_chan, w_chan) = channel.split()?;
        // input protocol and transport
        let r_tran = self.r_trans_factory.create(Box::new(r_chan));
        let i_prot = self.i_proto_factory.create(r_tran);
        // output protocol and transport
        let w_tran = self.w_trans_factory.create(Box::new(w_chan));
        let o_prot = self.o_proto_factory.create(w_tran);
        Ok((i_prot, o_prot))
    }
async fn new_protocols_for_connection ( & mut self , stream : TcpStream , ) -> crate :: Result < ( Box < dyn TAsyncInputProtocol + Send > , Box < dyn TAsyncOutputProtocol + Send > ) > { // create the shared tcp stream let channel = TAsyncTcpChannel :: with_stream ( stream ) ; // split it into two - one to be owned by the // input tran/proto and the other by the output let ( r_chan , w_chan ) = channel . split ( ) ? ; // input protocol and transport let r_tran = self . r_trans_factory . create ( Box :: new ( r_chan ) ) ; let i_prot = self . i_proto_factory . create ( r_tran ) ; // output protocol and transport let w_tran = self . w_trans_factory . create ( Box :: new ( w_chan ) ) ; let o_prot = self . o_proto_factory . create ( w_tran ) ; Ok ( ( i_prot , o_prot ) ) }
build io channel for connection
return input channel and output channel
build io channel for connection return input channel and output channel
&mut self
stream
TcpStream