Struct svc_agent::mqtt::OutgoingRequestProperties
source · pub struct OutgoingRequestProperties { /* private fields */ }
Expand description
Properties of an outgoing request.
Implementations§
source§impl OutgoingRequestProperties
impl OutgoingRequestProperties
sourcepub fn new(
method: &str,
response_topic: &str,
correlation_data: &str,
short_term_timing: OutgoingShortTermTimingProperties
) -> Self
pub fn new( method: &str, response_topic: &str, correlation_data: &str, short_term_timing: OutgoingShortTermTimingProperties ) -> Self
Builds OutgoingRequestProperties.
Use this function only if you’re making a request from scratch.
If you make a request while handling another request consider using IncomingRequestProperties::to_request.
Arguments
method
– request method.response_topic
– a topic to send the response to the request to.correlation_data
– any string to correlate request with the upcoming response.short_term_timing
– outgoing request’s short term timing properties.
Example
let props = OutgoingRequestProperties::new(
"system.vacuum",
&Subscription::unicast_responses(),
OutgoingShortTermTimingProperties::new(Utc::now()),
);
pub fn set_agent_id(&mut self, agent_id: AgentId) -> &mut Self
pub fn set_long_term_timing( &mut self, timing: LongTermTimingProperties ) -> &mut Self
pub fn set_tracking(&mut self, tracking: TrackingProperties) -> &mut Self
pub fn set_local_tracking_label( &mut self, local_tracking_label: String ) -> &mut Self
pub fn set_local_timestamp( &mut self, local_timestamp: DateTime<Utc> ) -> &mut Self
pub fn correlation_data(&self) -> &str
Trait Implementations§
source§impl Debug for OutgoingRequestProperties
impl Debug for OutgoingRequestProperties
Auto Trait Implementations§
impl RefUnwindSafe for OutgoingRequestProperties
impl Send for OutgoingRequestProperties
impl Sync for OutgoingRequestProperties
impl Unpin for OutgoingRequestProperties
impl UnwindSafe for OutgoingRequestProperties
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more