[][src]Type Definition svc_agent::mqtt::OutgoingRequest

type OutgoingRequest<T> = OutgoingMessage<T, OutgoingRequestProperties>;

Methods

impl<T> OutgoingRequest<T> where
    T: Serialize
[src]

pub fn multicast<A>(
    payload: T,
    properties: OutgoingRequestProperties,
    to: &A
) -> Self where
    A: Authenticable
[src]

Builds a multicast request to publish.

Arguments

  • payload – any serializable value.
  • properties – properties of the outgoing request.
  • to – destination AccountId.

Example

let props = request.to_request(
    "room.enter",
    &Subscription::unicast_responses(),
    ShortTermTimingProperties::until_now(start_timestamp),
);

let message = OutgoingRequest::multicast(json!({ "foo": "bar" }), props);

pub fn unicast<A>(
    payload: T,
    properties: OutgoingRequestProperties,
    to: &A,
    version: &str
) -> Self where
    A: Addressable
[src]

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.to_request(
    "room.enter",
    &Subscription::unicast_responses(),
    ShortTermTimingProperties::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

impl<T> IntoEnvelope for OutgoingRequest<T> where
    T: Serialize
[src]

impl<T: Serialize> Publishable for OutgoingRequest<T> where
    OutgoingRequest<T>: IntoEnvelope
[src]