Enum pact_matching::Mismatch
source · pub enum Mismatch {
MethodMismatch {
expected: String,
actual: String,
},
PathMismatch {
expected: String,
actual: String,
mismatch: String,
},
StatusMismatch {
expected: u16,
actual: u16,
mismatch: String,
},
QueryMismatch {
parameter: String,
expected: String,
actual: String,
mismatch: String,
},
HeaderMismatch {
key: String,
expected: String,
actual: String,
mismatch: String,
},
BodyTypeMismatch {
expected: String,
actual: String,
mismatch: String,
expected_body: Option<Bytes>,
actual_body: Option<Bytes>,
},
BodyMismatch {
path: String,
expected: Option<Bytes>,
actual: Option<Bytes>,
mismatch: String,
},
MetadataMismatch {
key: String,
expected: String,
actual: String,
mismatch: String,
},
}
Expand description
Enum that defines the different types of mismatches that can occur.
Variants§
MethodMismatch
Request Method mismatch
PathMismatch
Request Path mismatch
Fields
StatusMismatch
Response status mismatch
Fields
QueryMismatch
Request query mismatch
Fields
HeaderMismatch
Header mismatch
Fields
BodyTypeMismatch
Mismatch in the content type of the body
Fields
BodyMismatch
Body element mismatch
Fields
MetadataMismatch
Message metadata mismatch
Implementations§
source§impl Mismatch
impl Mismatch
sourcepub fn mismatch_type(&self) -> &str
pub fn mismatch_type(&self) -> &str
Returns the type of the mismatch as a string
sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Returns a formatted string for this mismatch
sourcepub fn ansi_description(&self) -> String
pub fn ansi_description(&self) -> String
Returns a formatted string with ansi escape codes for this mismatch
Trait Implementations§
source§impl From<Mismatch> for CommonMismatch
impl From<Mismatch> for CommonMismatch
source§impl Ord for Mismatch
impl Ord for Mismatch
source§impl PartialEq for Mismatch
impl PartialEq for Mismatch
source§impl PartialOrd for Mismatch
impl PartialOrd for Mismatch
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Mismatch
Auto Trait Implementations§
impl !Freeze for Mismatch
impl RefUnwindSafe for Mismatch
impl Send for Mismatch
impl Sync for Mismatch
impl Unpin for Mismatch
impl UnwindSafe for Mismatch
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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.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.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request