pub struct ReplyAddress<F> { /* private fields */ }Expand description
The private reply address of an RPC request: the requester’s response topic and correlation token, plus the client to publish through.
Split off RpcRequest so serve can hand a handler the decoded message
(via RpcRequest::into_parts) while retaining the reply capability. Its
respond/respond_with take self by move — one reply per request.
Implementations§
Source§impl<F> ReplyAddress<F>
impl<F> ReplyAddress<F>
Sourcepub async fn respond<ReplyT>(
self,
reply: &ReplyT,
) -> Result<PublishReceipt, MqttClientError>
pub async fn respond<ReplyT>( self, reply: &ReplyT, ) -> Result<PublishReceipt, MqttClientError>
Publish the reply to the requester’s response topic, echoing its
correlation token. Takes self: one reply per request, enforced by move.
A hostile or malformed peer response_topic is caught here —
get_publisher applies the usual wildcard/empty-topic validation, so a
bad address fails cleanly rather than mis-routing.
Sourcepub async fn respond_with<ReplyT>(
self,
reply: &ReplyT,
options: PublishOptions,
) -> Result<PublishReceipt, MqttClientError>
pub async fn respond_with<ReplyT>( self, reply: &ReplyT, options: PublishOptions, ) -> Result<PublishReceipt, MqttClientError>
Publish the reply with custom PublishOptions (QoS, user properties).
The correlation token is always echoed, overriding any correlation set on
options.