pub async fn handle_process_result(
    msg_ident: &TMessageIdentifier,
    res: crate::Result<()>,
    o_prot: &mut (dyn TAsyncOutputProtocol + Send),
) -> crate::Result<()> {
    if let Err(e) = res {
        let e = match e {
            crate::Error::Application(a) => a,
            _ => ApplicationError::new(ApplicationErrorKind::Unknown, format!("{:?}", e)),
        };

        let ident = TMessageIdentifier::new(
            msg_ident.name.clone(),
            TMessageType::Exception,
            msg_ident.sequence_number,
        );

        o_prot.write_message_begin(&ident).await?;
        super::Error::write_application_error_to_out_protocol(&e, o_prot).await?;
        o_prot.write_message_end().await?;
        o_prot.flush().await
    } else {
        Ok(())
    }
}
/// Convenience function used in generated `TProcessor` implementations to
/// return an `ApplicationError` if thrift message processing failed.
Convenience function used in generated `TProcessor` implementations to
return an `ApplicationError` if thrift message processing failed.
Convenience function used in generated ` TProcessor ` implementations to return an ` ApplicationError ` if thrift message processing failed .
pub async fn handle_process_result(
    msg_ident: &TMessageIdentifier,
    res: crate::Result<()>,
    o_prot: &mut (dyn TAsyncOutputProtocol + Send),
) -> crate::Result<()> {
    if let Err(e) = res {
        let e = match e {
            crate::Error::Application(a) => a,
            _ => ApplicationError::new(ApplicationErrorKind::Unknown, format!("{:?}", e)),
        };
        let ident = TMessageIdentifier::new(
            msg_ident.name.clone(),
            TMessageType::Exception,
            msg_ident.sequence_number,
        );
        o_prot.write_message_begin(&ident).await?;
        super::Error::write_application_error_to_out_protocol(&e, o_prot).await?;
        o_prot.write_message_end().await?;
        o_prot.flush().await
    } else {
        Ok(())
    }
}
pub async fn handle_process_result ( msg_ident : & TMessageIdentifier , res : crate :: Result < ( ) > , o_prot : & mut ( dyn TAsyncOutputProtocol + Send ) , ) -> crate :: Result < ( ) > { if let Err ( e ) = res { let e = match e { crate :: Error :: Application ( a ) => a , _ => ApplicationError :: new ( ApplicationErrorKind :: Unknown , format ! ( " " e ) ) , } ; let ident = TMessageIdentifier :: new ( msg_ident . name . clone ( ) , TMessageType :: Exception , msg_ident . sequence_number , ) ; o_prot . write_message_begin ( & ident ) . await ? ; super :: Error :: write_application_error_to_out_protocol ( & e , o_prot ) . await ? ; o_prot . write_message_end ( ) . await ? ; o_prot . flush ( ) . await } else { Ok ( ( ) ) } }
Convenience function used in generated `TProcessor` implementations to
return an `ApplicationError` if thrift message processing failed.
Convenience function used in generated ` TProcessor ` implementations to return an ` ApplicationError ` if thrift message processing failed .
msg_ident
&TMessageIdentifier
res
crate::Result<()>
o_prot
&mut (dyn TAsyncOutputProtocol + Send)