/// A helper function that runs the batch call and checks the result.
A helper function that runs the batch call and checks the result.
A helper function that runs the batch call and checks the result .
fn check_run<F>(bt: BatchType, f: F) -> BatchFuture
where
    F: FnOnce(*mut GrpcBatchContext, *mut c_void) -> GrpcCallStatus,
{
    let (cq_f, tag) = CallTag::batch_pair(bt);
    let (batch_ptr, tag_ptr) = box_batch_tag(tag);
    let code = f(batch_ptr, tag_ptr);
    if code != GrpcCallStatus::Ok {
        unsafe {
            Box::from_raw(tag_ptr);
        }
        panic!("create call fail: {:?}", code);
    }
    cq_f
}
fn check_run < F > ( bt : BatchType , f : F ) -> BatchFuture where F : FnOnce ( * mut GrpcBatchContext , * mut c_void ) -> GrpcCallStatus , { let ( cq_f , tag ) = CallTag :: batch_pair ( bt ) ; let ( batch_ptr , tag_ptr ) = box_batch_tag ( tag ) ; let code = f ( batch_ptr , tag_ptr ) ; if code != GrpcCallStatus :: Ok { unsafe { Box :: from_raw ( tag_ptr ) ; } panic ! ( " " code ) ; } cq_f }
A helper function that runs the batch call and checks the result.
A helper function that runs the batch call and checks the result .
bt
BatchType
f
F