[][src]Struct svc_agent::mqtt::LongTermTimingProperties

pub struct LongTermTimingProperties { /* fields omitted */ }

Timing properties that persist through a message chain.

See OutgoingShortTermTimingProperties for more explanation on timings.

There are two kinds of properties: regular an cumulative. Regular properties just get proxied without change to the next message in the chain. Cumulative properties sum corresponding values from OutgoingShortTermTimingProperties.

If you use methods like to_response, to_request, to_event and similar then you shouldn't think about long term timings since they already take care of all these things.

Methods

impl LongTermTimingProperties[src]

pub fn update_cumulative_timings(
    self,
    short_timing: &OutgoingShortTermTimingProperties
) -> Self
[src]

Updates cumulative values with the given OutgoingShortTermTimingProperties values.

Prefer using to_response and similar methods for building responses. If you by any chance can't use them but still want to pass LongTermTimingProperties manually then this is the method to call to keep timings consistent.

Arguments

Example

let short_term_timing = OutgoingShortTermTimingProperties::until_now(start_timestamp);

let long_term_timing = response
    .properties()
    .long_term_timing()
    .clone()
    .update_cumulative_timings(&short_term_timing);

let props = OutgoingResponseProperties::new(
    response.properties().status(),
    request.correlation_data(),
    long_term_timing,
    short_term_timing,
    response.properties().tracking().clone(),
);

let message = OutgoingResponse::unicast(
    response.payload().to_owned(),
    props,
    request.properties(),
    "v1"
);

Trait Implementations

impl Clone for LongTermTimingProperties[src]

impl Debug for LongTermTimingProperties[src]

impl<'de> Deserialize<'de> for LongTermTimingProperties[src]

impl Serialize for LongTermTimingProperties[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,