Type Definition svc_agent::mqtt::OutgoingRequest

source ·
pub type OutgoingRequest<T> = OutgoingMessageContent<T, OutgoingRequestProperties>;

Implementations§

source§

impl<T> OutgoingRequest<T>where T: Serialize,

source

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);
source

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,

source§

fn into_envelope(self) -> Result<OutgoingEnvelope, Error>

Wraps an outgoing message into envelope format.
source§

impl<T: Serialize> Publishable for OutgoingRequest<T>

source§

fn destination_topic(&self, publisher: &Address) -> Result<String, Error>

Returns a destination topic as string. Read more
source§

fn qos(&self) -> QoS

Returns QoS for publishing.