/// Send a status from server.
Send a status from server.
Send a status from server .
pub fn start_send_status_from_server(
        &mut self,
        status: &RpcStatus,
        send_empty_metadata: bool,
        payload: &Option<Vec<u8>>,
        write_flags: u32,
    ) -> Result<BatchFuture> {
        let _cq_ref = self.cq.borrow()?;
        let send_empty_metadata = if send_empty_metadata { 1 } else { 0 };
        let (payload_ptr, payload_len) = payload
            .as_ref()
            .map_or((ptr::null(), 0), |b| (b.as_ptr(), b.len()));
        let f = check_run(BatchType::Finish, |ctx, tag| unsafe {
            let details_ptr = status
                .details
                .as_ref()
                .map_or_else(ptr::null, |s| s.as_ptr() as _);
            let details_len = status.details.as_ref().map_or(0, String::len);
            grpc_sys::grpcwrap_call_send_status_from_server(
                self.call,
                ctx,
                status.status,
                details_ptr,
                details_len,
                ptr::null_mut(),
                send_empty_metadata,
                payload_ptr as _,
                payload_len,
                write_flags,
                tag,
            )
        });
        Ok(f)
    }
pub fn start_send_status_from_server ( & mut self , status : & RpcStatus , send_empty_metadata : bool , payload : & Option < Vec < u8 > > , write_flags : u32 , ) -> Result < BatchFuture > { let _cq_ref = self . cq . borrow ( ) ? ; let send_empty_metadata = if send_empty_metadata { 1 } else { 0 } ; let ( payload_ptr , payload_len ) = payload . as_ref ( ) . map_or ( ( ptr :: null ( ) , 0 ) , | b | ( b . as_ptr ( ) , b . len ( ) ) ) ; let f = check_run ( BatchType :: Finish , | ctx , tag | unsafe { let details_ptr = status . details . as_ref ( ) . map_or_else ( ptr :: null , | s | s . as_ptr ( ) as _ ) ; let details_len = status . details . as_ref ( ) . map_or ( 0 , String :: len ) ; grpc_sys :: grpcwrap_call_send_status_from_server ( self . call , ctx , status . status , details_ptr , details_len , ptr :: null_mut ( ) , send_empty_metadata , payload_ptr as _ , payload_len , write_flags , tag , ) } ) ; Ok ( f ) }
Send a status from server.
Send a status from server .
&mut self
status
&RpcStatus
send_empty_metadata
bool
payload
&Option<Vec<u8>>
write_flags
u32