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

type OutgoingEvent<T> = OutgoingMessageContent<T, OutgoingEventProperties>;

Implementations

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

pub fn broadcast(
    payload: T,
    properties: OutgoingEventProperties,
    to_uri: &str
) -> OutgoingMessage<T>
[src]

Builds a broadcast event to publish.

Arguments

  • payload – any serializable value.
  • properties – properties of the outgoing event.
  • to_uri – broadcast resource path. See Destination for details.

Example

let short_term_timing = OutgoingShortTermTimingProperties::until_now(start_timestamp);

let message = OutgoingEvent::broadcast(
    json!({ "foo": "bar" }),
    request.to_event("message.create", short_term_timing),
    "rooms/123/events",
);

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

Builds a multicast event to publish.

Arguments

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

Example

let props = OutgoingEvent::multicast(
    json!({ "foo": "bar" }),
    request.to_event("message.create", short_term_timing),
    ,
);
let to = AgentId::new("instance01", AccountId::new("service_name", "svc.example.org"))
let message = OutgoingRequest::multicast(json!({ "foo": "bar" }), props, &to);

Trait Implementations

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

impl<T: Serialize> Publishable for OutgoingEvent<T>[src]