pub struct IncomingRequestProperties { /* private fields */ }
Expand description
Properties of an incoming request.
Implementations§
Source§impl IncomingRequestProperties
impl IncomingRequestProperties
pub fn method(&self) -> &str
pub fn correlation_data(&self) -> &str
pub fn response_topic(&self) -> &str
pub fn broker_agent_id(&self) -> &AgentId
pub fn long_term_timing(&self) -> &LongTermTimingProperties
pub fn short_term_timing(&self) -> &IncomingShortTermTimingProperties
pub fn tracking(&self) -> &TrackingProperties
pub fn local_tracking_label(&self) -> &Option<String>
pub fn to_connection(&self) -> Connection
pub fn set_method(&mut self, method: &str)
Sourcepub fn to_event(
&self,
label: &'static str,
short_term_timing: OutgoingShortTermTimingProperties,
) -> OutgoingEventProperties
pub fn to_event( &self, label: &'static str, short_term_timing: OutgoingShortTermTimingProperties, ) -> OutgoingEventProperties
Builds OutgoingEventProperties based on the IncomingRequestProperties.
Use it to publish an event when something worth notifying subscribers happens during the request processing.
§Arguments
label
– outgoing event label.short_term_timing
– outgoing event’s short term timing properties.
§Example
let short_term_timing = OutgoingShortTermTimingProperties::until_now(start_timestamp);
let out_props = in_props.to_event("agent.enter", short_term_timing);
Sourcepub fn to_request(
&self,
method: &str,
response_topic: &str,
correlation_data: &str,
short_term_timing: OutgoingShortTermTimingProperties,
) -> OutgoingRequestProperties
pub fn to_request( &self, method: &str, response_topic: &str, correlation_data: &str, short_term_timing: OutgoingShortTermTimingProperties, ) -> OutgoingRequestProperties
Builds OutgoingRequestProperties based on the IncomingRequestProperties.
Use it to send a request to another service while handling a request.
§Arguments
method
– request method.response_topic
– topic for response.correlation_data
– any string to correlate request with response.short_term_timing
– outgoing request’s short term timing properties.
§Example
let out_props = in_props.to_request(
"room.enter",
&Subscription::unicast_responses(),
OutgoingShortTermTimingProperties::until_now(start_timestamp),
);
Sourcepub fn to_response(
&self,
status: ResponseStatus,
short_term_timing: OutgoingShortTermTimingProperties,
) -> OutgoingResponseProperties
pub fn to_response( &self, status: ResponseStatus, short_term_timing: OutgoingShortTermTimingProperties, ) -> OutgoingResponseProperties
Builds OutgoingResponseProperties based on the IncomingRequestProperties.
Use it to response on a request.
§Arguments
status
– response status.short_term_timing
– outgoing response’s short term timings properties.
§Example
let short_term_timing = OutgoingShortTermTimingProperties::until_now(start_timestamp);
let out_props = in_props.to_response(ResponseStatus::OK, short_term_timing);
Trait Implementations§
Source§impl Addressable for &IncomingRequestProperties
impl Addressable for &IncomingRequestProperties
Source§fn as_agent_id(&self) -> &AgentId
fn as_agent_id(&self) -> &AgentId
Returns the AgentId reference of the addressable object.
Source§impl Addressable for IncomingRequestProperties
impl Addressable for IncomingRequestProperties
Source§fn as_agent_id(&self) -> &AgentId
fn as_agent_id(&self) -> &AgentId
Returns the AgentId reference of the addressable object.
Source§impl Authenticable for &IncomingRequestProperties
impl Authenticable for &IncomingRequestProperties
fn as_account_id(&self) -> &AccountId
Source§impl Authenticable for IncomingRequestProperties
impl Authenticable for IncomingRequestProperties
fn as_account_id(&self) -> &AccountId
Source§impl Clone for IncomingRequestProperties
impl Clone for IncomingRequestProperties
Source§fn clone(&self) -> IncomingRequestProperties
fn clone(&self) -> IncomingRequestProperties
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for IncomingRequestProperties
impl Debug for IncomingRequestProperties
Source§impl<'de> Deserialize<'de> for IncomingRequestProperties
impl<'de> Deserialize<'de> for IncomingRequestProperties
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IncomingRequestProperties
impl RefUnwindSafe for IncomingRequestProperties
impl Send for IncomingRequestProperties
impl Sync for IncomingRequestProperties
impl Unpin for IncomingRequestProperties
impl UnwindSafe for IncomingRequestProperties
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