Enum pact_matching::BodyMatchResult
source · pub enum BodyMatchResult {
Ok,
BodyTypeMismatch {
expected_type: String,
actual_type: String,
message: String,
expected: Option<Bytes>,
actual: Option<Bytes>,
},
BodyMismatches(HashMap<String, Vec<Mismatch>>),
}
Expand description
Result of matching a request body
Variants§
Ok
Matched OK
BodyTypeMismatch
Mismatch in the content type of the body
Fields
BodyMismatches(HashMap<String, Vec<Mismatch>>)
Mismatches with the body contents
Implementations§
source§impl BodyMatchResult
impl BodyMatchResult
sourcepub fn mismatches(&self) -> Vec<Mismatch>
pub fn mismatches(&self) -> Vec<Mismatch>
Returns all the mismatches
sourcepub fn all_matched(&self) -> bool
pub fn all_matched(&self) -> bool
If all the things matched OK
Trait Implementations§
source§impl Clone for BodyMatchResult
impl Clone for BodyMatchResult
source§fn clone(&self) -> BodyMatchResult
fn clone(&self) -> BodyMatchResult
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 BodyMatchResult
impl Debug for BodyMatchResult
source§impl PartialEq for BodyMatchResult
impl PartialEq for BodyMatchResult
source§fn eq(&self, other: &BodyMatchResult) -> bool
fn eq(&self, other: &BodyMatchResult) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for BodyMatchResult
Auto Trait Implementations§
impl !Freeze for BodyMatchResult
impl RefUnwindSafe for BodyMatchResult
impl Send for BodyMatchResult
impl Sync for BodyMatchResult
impl Unpin for BodyMatchResult
impl UnwindSafe for BodyMatchResult
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<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