pub struct CrossProtocolScenario {
pub trigger: CrossProtocolTrigger,
pub match_pattern: Option<String>,
pub scenario_name: String,
pub target_state: String,
}Expand description
A cross-protocol scenario correlation: when a protocol event matching
trigger (and optionally match_pattern)
is observed, the named scenario is advanced to target_state.
Maps to entries of the crossProtocolScenarios array.
§Example
use mockserver_client::{CrossProtocolScenario, CrossProtocolTrigger};
let scenario = CrossProtocolScenario::new(
CrossProtocolTrigger::DnsQuery,
"Deploy",
"DnsObserved",
)
.match_pattern("api.example.com");Fields§
§trigger: CrossProtocolTrigger§match_pattern: Option<String>§scenario_name: String§target_state: StringImplementations§
Source§impl CrossProtocolScenario
impl CrossProtocolScenario
Sourcepub fn new(
trigger: CrossProtocolTrigger,
scenario_name: impl Into<String>,
target_state: impl Into<String>,
) -> Self
pub fn new( trigger: CrossProtocolTrigger, scenario_name: impl Into<String>, target_state: impl Into<String>, ) -> Self
Create a cross-protocol scenario for the given trigger that advances
scenario_name to target_state when an event fires.
Sourcepub fn match_pattern(self, pattern: impl Into<String>) -> Self
pub fn match_pattern(self, pattern: impl Into<String>) -> Self
Set the substring filter on the event identifier (omit to match all).
Trait Implementations§
Source§impl Clone for CrossProtocolScenario
impl Clone for CrossProtocolScenario
Source§fn clone(&self) -> CrossProtocolScenario
fn clone(&self) -> CrossProtocolScenario
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CrossProtocolScenario
impl Debug for CrossProtocolScenario
Source§impl<'de> Deserialize<'de> for CrossProtocolScenario
impl<'de> Deserialize<'de> for CrossProtocolScenario
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
impl Eq for CrossProtocolScenario
Source§impl PartialEq for CrossProtocolScenario
impl PartialEq for CrossProtocolScenario
Source§fn eq(&self, other: &CrossProtocolScenario) -> bool
fn eq(&self, other: &CrossProtocolScenario) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CrossProtocolScenario
impl Serialize for CrossProtocolScenario
impl StructuralPartialEq for CrossProtocolScenario
Auto Trait Implementations§
impl Freeze for CrossProtocolScenario
impl RefUnwindSafe for CrossProtocolScenario
impl Send for CrossProtocolScenario
impl Sync for CrossProtocolScenario
impl Unpin for CrossProtocolScenario
impl UnsafeUnpin for CrossProtocolScenario
impl UnwindSafe for CrossProtocolScenario
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.