Sends the pw_protobuf response for an asynchronous unary RPC on a server.
| Response | The generated pw_protobuf response message struct type. |
Public Member Functions | |
| constexpr | PwpbUnaryResponder ()=default |
Creates an inactive PwpbUnaryResponder into which an active call can be moved. | |
| PwpbUnaryResponder (PwpbUnaryResponder &&)=default | |
| PwpbUnaryResponder & | operator= (PwpbUnaryResponder &&)=default |
| Status | Finish (const Response &response, Status status=OkStatus()) |
Sends the unary Response message and status, closing the RPC. | |
| Status | TryFinish (const Response &response, Status status=OkStatus()) |
Attempts to close the RPC and send the unary Response message and status to the client. | |
Static Public Member Functions | |
| template<auto kMethod, typename ServiceImpl > | |
| static PwpbUnaryResponder | Open (Server &server, uint32_t channel_id, ServiceImpl &service) |
Creates a PwpbUnaryResponder that is ready to send responses for a particular RPC. | |
Friends | |
| class | internal::Call |
| class | internal::PwpbMethod |
| class | Server |
| template<typename , typename , uint32_t > | |
| class | internal::test::InvocationContext |
|
inline |
Sends the unary Response message and status, closing the RPC.
| [in] | response | The Response message struct to encode and send. |
| [in] | status | The overall status of the RPC to send to the client. |
pw_rpc was unable to encode the pw_protobuf message.ChannelOutput implementation if sending the packet failed.
|
inlinestatic |
Creates a PwpbUnaryResponder that is ready to send responses for a particular RPC.
This can be used for testing or to send responses to an RPC that has not been started by a client.
| kMethod | Pointer to the generated service method. |
| ServiceImpl | The service implementation class. |
| [in,out] | server | The RPC Server on which to open the call. |
| [in] | channel_id | The ID of the channel on which to send the response. |
| [in,out] | service | The registered service instance handling the RPC. |
PwpbUnaryResponder bound to the specified channel and method.
|
inline |
Attempts to close the RPC and send the unary Response message and status to the client.
Unlike Finish(), the call remains open if sending the packet fails, allowing the caller to retry.
| [in] | response | The Response message struct to encode and send. |
| [in] | status | The overall status of the RPC to send to the client. |
pw_rpc was unable to encode the pw_protobuf message.ChannelOutput implementation if sending the packet failed (the call remains active).