pub type OutgoingRequest<T> = OutgoingMessageContent<T, OutgoingRequestProperties>;
Aliased Type§
pub struct OutgoingRequest<T> { /* private fields */ }
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.