[][src]Struct svc_agent::mqtt::IncomingMessage

pub struct IncomingMessage<T, P> where
    P: Addressable
{ /* fields omitted */ }

A generic received message.

Methods

impl<T, P> IncomingMessage<T, P> where
    P: Addressable
[src]

pub fn new(payload: T, properties: P) -> Self[src]

pub fn payload(&self) -> &T[src]

pub fn properties(&self) -> &P[src]

impl<T> IncomingMessage<T, IncomingRequestProperties>[src]

pub fn to_response<R>(
    &self,
    data: R,
    status: ResponseStatus,
    timing: ShortTermTimingProperties,
    api_version: &str
) -> OutgoingResponse<R> where
    R: Serialize
[src]

Builds OutgoingResponse based on the IncomingRequest.

Use it to response on a request.

Arguments

  • data – serializable response payload.
  • status – response status.
  • timing – outgoing response's short term timing properties.

Example

let response = request.to_response(
    json!({ "foo": "bar" }),
    ResponseStatus::OK,
    ShortTermTimingProperties::until_now(start_timestamp),
);

Trait Implementations

impl<T: Debug, P: Debug> Debug for IncomingMessage<T, P> where
    P: Addressable
[src]

Auto Trait Implementations

impl<T, P> RefUnwindSafe for IncomingMessage<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe

impl<T, P> Send for IncomingMessage<T, P> where
    T: Send

impl<T, P> Sync for IncomingMessage<T, P> where
    T: Sync

impl<T, P> Unpin for IncomingMessage<T, P> where
    P: Unpin,
    T: Unpin

impl<T, P> UnwindSafe for IncomingMessage<T, P> where
    P: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,