/// Accept a client side unary request.
///
/// This method should be called after `handle_stream_req`. When handling
/// client side unary request, handler will only be called after the unary
/// request is received.
Accept a client side unary request.
This method should be called after `handle_stream_req`. When handling
client side unary request, handler will only be called after the unary
request is received.
Accept a client side unary request . This method should be called after ` handle_stream_req ` . When handling client side unary request handler will only be called after the unary request is received .
pub fn handle_unary_req(self, rc: RequestCallContext, _: &CompletionQueue) {
        // fetch message before calling callback.
        let tag = Box::new(CallTag::unary_request(self, rc));
        let batch_ctx = tag.batch_ctx().unwrap().as_ptr();
        let request_ctx = tag.request_ctx().unwrap().as_ptr();
        let tag_ptr = Box::into_raw(tag);
        unsafe {
            let call = grpc_sys::grpcwrap_request_call_context_get_call(request_ctx);
            let code = grpc_sys::grpcwrap_call_recv_message(call, batch_ctx, tag_ptr as _);
            if code != GrpcCallStatus::Ok {
                Box::from_raw(tag_ptr);
                // it should not failed.
                panic!("try to receive message fail: {:?}", code);
            }
        }
    }
pub fn handle_unary_req ( self , rc : RequestCallContext , _ : & CompletionQueue ) { // fetch message before calling callback. let tag = Box :: new ( CallTag :: unary_request ( self , rc ) ) ; let batch_ctx = tag . batch_ctx ( ) . unwrap ( ) . as_ptr ( ) ; let request_ctx = tag . request_ctx ( ) . unwrap ( ) . as_ptr ( ) ; let tag_ptr = Box :: into_raw ( tag ) ; unsafe { let call = grpc_sys :: grpcwrap_request_call_context_get_call ( request_ctx ) ; let code = grpc_sys :: grpcwrap_call_recv_message ( call , batch_ctx , tag_ptr as _ ) ; if code != GrpcCallStatus :: Ok { Box :: from_raw ( tag_ptr ) ; // it should not failed. panic ! ( " " code ) ; } } }
Accept a client side unary request.
Accept a client side unary request .
self
rc
&CompletionQueue