[−][src]Type Definition svc_agent::mqtt::OutgoingResponse
type OutgoingResponse<T> = OutgoingMessage<T, OutgoingResponseProperties>;
Methods
impl<T> OutgoingResponse<T> where
T: Serialize,
[src]
T: Serialize,
pub fn unicast<A>(
payload: T,
properties: OutgoingResponseProperties,
to: &A,
version: &str
) -> Self where
A: Addressable,
[src]
payload: T,
properties: OutgoingResponseProperties,
to: &A,
version: &str
) -> Self 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 = ShortTermTimingProperties::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,
fn into_envelope(self) -> Result<OutgoingEnvelope, Error>
[src]
impl<T: Serialize> Publishable for OutgoingResponse<T> where
OutgoingResponse<T>: IntoEnvelope,
[src]
OutgoingResponse<T>: IntoEnvelope,