/// Consume the request and automatically send the response back to the client.
Consume the request and automatically send the response back to the client.
Consume the request and automatically send the response back to the client .
pub fn respond(self, response: T::ResponseMessage) -> Result<(), NetworkError> {
        let packet = NetworkPacket {
            kind: String::from(T::RESPONSE_NAME),
            data: bincode::serialize(&ResponseInternal {
                response_id: self.request_id,
                response,
            })
            .map_err(|_| NetworkError::Serialization)?,
        };
        self.response_tx
            .try_send(packet)
            .map_err(|_| NetworkError::SendError)
    }
pub fn respond ( self , response : T :: ResponseMessage ) -> Result < ( ) , NetworkError > { let packet = NetworkPacket { kind : String :: from ( T :: RESPONSE_NAME ) , data : bincode :: serialize ( & ResponseInternal { response_id : self . request_id , response , } ) . map_err ( | _ | NetworkError :: Serialization ) ? , } ; self . response_tx . try_send ( packet ) . map_err ( | _ | NetworkError :: SendError ) }
Consume the request and automatically send the response back to the client.
Consume the request and automatically send the response back to the client .
self
response
T::ResponseMessage