[−][src]Type Definition svc_agent::mqtt::OutgoingResponse
type OutgoingResponse<T> = OutgoingMessageContent<T, OutgoingResponseProperties>;
Implementations
impl<T> OutgoingResponse<T> where
T: Serialize,
[src]
T: Serialize,
pub fn unicast<A>(
payload: T,
properties: OutgoingResponseProperties,
to: &A,
version: &str
) -> OutgoingMessage<T> where
A: Addressable,
[src]
payload: T,
properties: OutgoingResponseProperties,
to: &A,
version: &str
) -> OutgoingMessage<T> where
A: Addressable,
Builds a unicast response to publish.
Arguments
payload
– any serializable value.properties
– properties of the outgoing response.to
– destination AgentId.version
– destination agent's API version.
Example
let short_term_timing = OutgoingShortTermTimingProperties::until_now(start_timestamp); let props = request.properties().to_response(ResponseStatus::OK, short_term_timing) let to = AgentId::new("instance01", AccountId::new("service_name", "svc.example.org")); let message = OutgoingResponse::unicast(json!({ "foo": "bar" }), props, to, "v1");
Trait Implementations
impl<T> IntoEnvelope for OutgoingResponse<T> where
T: Serialize,
[src]
T: Serialize,