Type Definition svc_agent::mqtt::OutgoingRequest
source · pub type OutgoingRequest<T> = OutgoingMessageContent<T, OutgoingRequestProperties>;
Implementations§
source§impl<T> OutgoingRequest<T>where
T: Serialize,
impl<T> OutgoingRequest<T>where T: Serialize,
sourcepub fn multicast<A>(
payload: T,
properties: OutgoingRequestProperties,
to: &A,
version: &str
) -> OutgoingMessage<T>where
A: Authenticable,
pub fn multicast<A>( payload: T, properties: OutgoingRequestProperties, to: &A, version: &str ) -> OutgoingMessage<T>where A: Authenticable,
Builds a multicast request to publish.
Arguments
payload
– any serializable value.properties
– properties of the outgoing request.to
– destination AccountId.
Example
let props = request.properties().to_request(
"room.enter",
&Subscription::unicast_responses(),
"some_corr_data",
OutgoingShortTermTimingProperties::until_now(start_timestamp),
);
let to = AccountId::new("service_name", "svc.example.org");
let message = OutgoingRequest::multicast(json!({ "foo": "bar" }), props, &to);
sourcepub fn unicast<A>(
payload: T,
properties: OutgoingRequestProperties,
to: &A,
version: &str
) -> OutgoingMessage<T>where
A: Addressable,
pub fn unicast<A>( payload: T, properties: OutgoingRequestProperties, to: &A, version: &str ) -> OutgoingMessage<T>where A: Addressable,
Builds a unicast request to publish.
Arguments
payload
– any serializable value.properties
– properties of the outgoing request.to
– destination AgentId.version
– destination agent’s API version.
Example
let props = request.properties().to_request(
"room.enter",
&Subscription::unicast_responses(),
"some_corr_data",
OutgoingShortTermTimingProperties::until_now(start_timestamp),
);
let to = AgentId::new("instance01", AccountId::new("service_name", "svc.example.org"));
let message = OutgoingRequest::unicast(json!({ "foo": "bar" }), props, to, "v1");
Trait Implementations§
source§impl<T> IntoEnvelope for OutgoingRequest<T>where
T: Serialize,
impl<T> IntoEnvelope for OutgoingRequest<T>where T: Serialize,
source§fn into_envelope(self) -> Result<OutgoingEnvelope, Error>
fn into_envelope(self) -> Result<OutgoingEnvelope, Error>
Wraps an outgoing message into envelope format.