Struct pact_models::v4::sync_message::SynchronousMessage
source · pub struct SynchronousMessage {
pub id: Option<String>,
pub key: Option<String>,
pub description: String,
pub provider_states: Vec<ProviderState>,
pub comments: HashMap<String, Value>,
pub request: MessageContents,
pub response: Vec<MessageContents>,
pub pending: bool,
pub plugin_config: HashMap<String, HashMap<String, Value>>,
pub interaction_markup: InteractionMarkup,
pub transport: Option<String>,
}
Expand description
Synchronous interactions as a request message to a sequence of response messages
Fields§
§id: Option<String>
Interaction ID. This will only be set if the Pact file was fetched from a Pact Broker
key: Option<String>
Unique key for this interaction
description: String
A description for the interaction. Must be unique within the Pact file
provider_states: Vec<ProviderState>
Optional provider state for the interaction. See https://docs.pact.io/getting_started/provider_states for more info on provider states.
comments: HashMap<String, Value>
Annotations and comments associated with this interaction
request: MessageContents
Request message
response: Vec<MessageContents>
Response messages
pending: bool
If this interaction is pending. Pending interactions will never fail the build if they fail
plugin_config: HashMap<String, HashMap<String, Value>>
Configuration added by plugins
interaction_markup: InteractionMarkup
Text markup to use to render the interaction in a UI
transport: Option<String>
Transport mechanism used with this message
Implementations§
source§impl SynchronousMessage
impl SynchronousMessage
sourcepub fn with_key(&self) -> SynchronousMessage
pub fn with_key(&self) -> SynchronousMessage
Creates a new version with a calculated key
Trait Implementations§
source§impl Clone for SynchronousMessage
impl Clone for SynchronousMessage
source§fn clone(&self) -> SynchronousMessage
fn clone(&self) -> SynchronousMessage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SynchronousMessage
impl Debug for SynchronousMessage
source§impl Default for SynchronousMessage
impl Default for SynchronousMessage
source§impl Display for SynchronousMessage
impl Display for SynchronousMessage
source§impl Hash for SynchronousMessage
impl Hash for SynchronousMessage
source§impl Interaction for SynchronousMessage
impl Interaction for SynchronousMessage
source§fn is_request_response(&self) -> bool
fn is_request_response(&self) -> bool
If this is a request/response interaction
source§fn as_request_response(&self) -> Option<RequestResponseInteraction>
fn as_request_response(&self) -> Option<RequestResponseInteraction>
Returns the request/response interaction if it is one
source§fn is_message(&self) -> bool
fn is_message(&self) -> bool
If this is a message interaction
source§fn as_message(&self) -> Option<Message>
fn as_message(&self) -> Option<Message>
Returns the message interaction if it is one
source§fn id(&self) -> Option<String>
fn id(&self) -> Option<String>
Interaction ID. This will only be set if the Pact file was fetched from a Pact Broker
source§fn description(&self) -> String
fn description(&self) -> String
Description of this interaction. This needs to be unique in the pact file.
source§fn set_description(&mut self, description: &str)
fn set_description(&mut self, description: &str)
Set the description of this interaction. This needs to be unique in the pact file.
source§fn provider_states(&self) -> Vec<ProviderState>
fn provider_states(&self) -> Vec<ProviderState>
Optional provider states for the interaction.
See
<https://docs.pact.io/getting_started/provider_states>
for more info on provider states.source§fn provider_states_mut(&mut self) -> &mut Vec<ProviderState>
fn provider_states_mut(&mut self) -> &mut Vec<ProviderState>
Mutable Optional provider states for the interaction.
See
<https://docs.pact.io/getting_started/provider_states>
for more info on provider states.source§fn contents(&self) -> OptionalBody
fn contents(&self) -> OptionalBody
👎Deprecated since 0.1.0: Some interactions have multiple contents (like request/response), so it is impossible to know which to return for this method
Body of the response or message
source§fn contents_for_verification(&self) -> OptionalBody
fn contents_for_verification(&self) -> OptionalBody
The contents of the part to use for verification. For example, with HTTP interactions, this
will be the response body
source§fn content_type(&self) -> Option<ContentType>
fn content_type(&self) -> Option<ContentType>
👎Deprecated since 0.1.0: Some interactions have multiple contents (like request/response), so it is impossible to know which to return for this method
Determine the content type of the interaction. If a
Content-Type
header or metadata value is present, the
value of that value will be returned. Otherwise, the contents will be inspected.source§fn as_v4(&self) -> Option<Box<dyn V4Interaction + Send + Sync + RefUnwindSafe>>
fn as_v4(&self) -> Option<Box<dyn V4Interaction + Send + Sync + RefUnwindSafe>>
Returns the interaction in V4 format
source§fn as_v4_mut(&mut self) -> Option<&mut dyn V4Interaction>
fn as_v4_mut(&mut self) -> Option<&mut dyn V4Interaction>
Returns a mutable reference for the interaction. If the interaction is not a V4 format,
will return None. The
as_v4
method can convert to V4 format (via cloning the data).source§fn as_v4_http(&self) -> Option<SynchronousHttp>
fn as_v4_http(&self) -> Option<SynchronousHttp>
Returns the interaction in V4 format
source§fn as_v4_async_message(&self) -> Option<AsynchronousMessage>
fn as_v4_async_message(&self) -> Option<AsynchronousMessage>
Returns the interaction in V4 format
source§fn as_v4_sync_message(&self) -> Option<SynchronousMessage>
fn as_v4_sync_message(&self) -> Option<SynchronousMessage>
Returns the interaction in V4 format
source§fn as_v4_http_mut(&mut self) -> Option<&mut SynchronousHttp>
fn as_v4_http_mut(&mut self) -> Option<&mut SynchronousHttp>
Returns the interaction in V4 format
source§fn is_v4_sync_message(&self) -> bool
fn is_v4_sync_message(&self) -> bool
If the interaction is a V4 synchronous request/response message
source§fn as_v4_async_message_mut(&mut self) -> Option<&mut AsynchronousMessage>
fn as_v4_async_message_mut(&mut self) -> Option<&mut AsynchronousMessage>
Returns the interaction in V4 format
source§fn as_v4_sync_message_mut(&mut self) -> Option<&mut SynchronousMessage>
fn as_v4_sync_message_mut(&mut self) -> Option<&mut SynchronousMessage>
Returns the interaction in V4 format
source§fn boxed(&self) -> Box<dyn Interaction + Send + Sync + RefUnwindSafe>
fn boxed(&self) -> Box<dyn Interaction + Send + Sync + RefUnwindSafe>
Clones this interaction and wraps it in a Box
source§fn arced(&self) -> Arc<dyn Interaction + Send + Sync + RefUnwindSafe>
fn arced(&self) -> Arc<dyn Interaction + Send + Sync + RefUnwindSafe>
Clones this interaction and wraps it in an Arc
source§fn thread_safe(
&self
) -> Arc<Mutex<dyn Interaction + Send + Sync + RefUnwindSafe>>
fn thread_safe( &self ) -> Arc<Mutex<dyn Interaction + Send + Sync + RefUnwindSafe>>
Clones this interaction and wraps it in an Arc and Mutex
source§fn matching_rules(&self) -> Option<MatchingRules>
fn matching_rules(&self) -> Option<MatchingRules>
👎Deprecated since 0.2.1: Some interactions have multiple contents (like request/response), so it is impossible to know which to return for this method
Returns the matching rules associated with this interaction (if there are any)
source§fn is_v4_http(&self) -> bool
fn is_v4_http(&self) -> bool
If the interaction is V4 HTTP
source§fn is_v4_async_message(&self) -> bool
fn is_v4_async_message(&self) -> bool
If the interaction is a V4 message
source§impl PartialEq for SynchronousMessage
impl PartialEq for SynchronousMessage
source§impl V4Interaction for SynchronousMessage
impl V4Interaction for SynchronousMessage
source§fn to_super(&self) -> &(dyn Interaction + Send + Sync + RefUnwindSafe)
fn to_super(&self) -> &(dyn Interaction + Send + Sync + RefUnwindSafe)
Convert the interaction to its super trait
source§fn to_super_mut(&mut self) -> &mut (dyn Interaction + Send + Sync)
fn to_super_mut(&mut self) -> &mut (dyn Interaction + Send + Sync)
Convert the interaction to its super trait
source§fn boxed_v4(&self) -> Box<dyn V4Interaction + Send + Sync + RefUnwindSafe>
fn boxed_v4(&self) -> Box<dyn V4Interaction + Send + Sync + RefUnwindSafe>
Clones this interaction and wraps it in a box
source§fn comments(&self) -> HashMap<String, Value>
fn comments(&self) -> HashMap<String, Value>
Annotations and comments associated with this interaction
source§fn comments_mut(&mut self) -> &mut HashMap<String, Value>
fn comments_mut(&mut self) -> &mut HashMap<String, Value>
Mutable access to the annotations and comments associated with this interaction
source§fn v4_type(&self) -> V4InteractionType
fn v4_type(&self) -> V4InteractionType
Type of this V4 interaction
source§fn plugin_config(&self) -> HashMap<String, HashMap<String, Value>>
fn plugin_config(&self) -> HashMap<String, HashMap<String, Value>>
Any configuration added to the interaction from a plugin
source§fn plugin_config_mut(&mut self) -> &mut HashMap<String, HashMap<String, Value>>
fn plugin_config_mut(&mut self) -> &mut HashMap<String, HashMap<String, Value>>
Any configuration added to the interaction from a plugin
source§fn interaction_markup(&self) -> InteractionMarkup
fn interaction_markup(&self) -> InteractionMarkup
Markup added to the interaction to render in UIs
source§fn interaction_markup_mut(&mut self) -> &mut InteractionMarkup
fn interaction_markup_mut(&mut self) -> &mut InteractionMarkup
Markup added to the interaction to render in UIs
source§fn set_transport(&mut self, transport: Option<String>)
fn set_transport(&mut self, transport: Option<String>)
Set the transport used with the interaction
source§fn with_unique_key(
&self
) -> Box<dyn V4Interaction + Send + Sync + RefUnwindSafe>
fn with_unique_key( &self ) -> Box<dyn V4Interaction + Send + Sync + RefUnwindSafe>
Creates a new version with a calculated key
source§fn unique_key(&self) -> String
fn unique_key(&self) -> String
Returns the current key if set, otherwise calculates a new one
impl Eq for SynchronousMessage
Auto Trait Implementations§
impl RefUnwindSafe for SynchronousMessage
impl Send for SynchronousMessage
impl Sync for SynchronousMessage
impl Unpin for SynchronousMessage
impl UnwindSafe for SynchronousMessage
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.