[−][src]Struct svc_agent::mqtt::OutgoingMessageContent
Implementations
impl<T, P> OutgoingMessageContent<T, P> where
T: Serialize,
[src]
T: Serialize,
pub fn properties(&self) -> &P
[src]
impl<T> OutgoingMessageContent<T, OutgoingEventProperties> where
T: Serialize,
[src]
T: Serialize,
pub fn broadcast(
payload: T,
properties: OutgoingEventProperties,
to_uri: &str
) -> OutgoingMessage<T>
[src]
payload: T,
properties: OutgoingEventProperties,
to_uri: &str
) -> OutgoingMessage<T>
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]
payload: T,
properties: OutgoingEventProperties,
to: &A
) -> OutgoingMessage<T> where
A: Authenticable,
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);
impl<T> OutgoingMessageContent<T, OutgoingRequestProperties> where
T: Serialize,
[src]
T: Serialize,
pub fn multicast<A>(
payload: T,
properties: OutgoingRequestProperties,
to: &A
) -> OutgoingMessage<T> where
A: Authenticable,
[src]
payload: T,
properties: OutgoingRequestProperties,
to: &A
) -> 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.to_request( "room.enter", &Subscription::unicast_responses(), OutgoingShortTermTimingProperties::until_now(start_timestamp), ); let message = OutgoingRequest::multicast(json!({ "foo": "bar" }), props);
pub fn unicast<A>(
payload: T,
properties: OutgoingRequestProperties,
to: &A,
version: &str
) -> OutgoingMessage<T> where
A: Addressable,
[src]
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.to_request( "room.enter", &Subscription::unicast_responses(), 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");
impl<T> OutgoingMessageContent<T, OutgoingResponseProperties> where
T: Serialize,
[src]
T: Serialize,
pub fn unicast<A>(
payload: T,
properties: OutgoingResponseProperties,
to: &A,
version: &str
) -> OutgoingMessage<T> where
A: Addressable,
[src]
payload: T,
properties: OutgoingResponseProperties,
to: &A,
version: &str
) -> OutgoingMessage<T> where
A: Addressable,
Builds a unicast response to publish.
Arguments
payload
– any serializable value.properties
– properties of the outgoing response.to
– destination AgentId.version
– destination agent's API version.
Example
let short_term_timing = OutgoingShortTermTimingProperties::until_now(start_timestamp); let props = request.properties().to_response(ResponseStatus::OK, short_term_timing) let to = AgentId::new("instance01", AccountId::new("service_name", "svc.example.org")); let message = OutgoingResponse::unicast(json!({ "foo": "bar" }), props, to, "v1");
Trait Implementations
Auto Trait Implementations
impl<T, P> RefUnwindSafe for OutgoingMessageContent<T, P> where
P: RefUnwindSafe,
T: RefUnwindSafe,
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> Send for OutgoingMessageContent<T, P> where
P: Send,
T: Send,
P: Send,
T: Send,
impl<T, P> Sync for OutgoingMessageContent<T, P> where
P: Sync,
T: Sync,
P: Sync,
T: Sync,
impl<T, P> Unpin for OutgoingMessageContent<T, P> where
P: Unpin,
T: Unpin,
P: Unpin,
T: Unpin,
impl<T, P> UnwindSafe for OutgoingMessageContent<T, P> where
P: UnwindSafe,
T: UnwindSafe,
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,