Enum pact_matching::Mismatch
[−]
[src]
pub enum Mismatch { MethodMismatch { expected: String, actual: String, }, PathMismatch { expected: String, actual: String, mismatch: String, }, StatusMismatch { expected: u16, actual: u16, }, QueryMismatch { parameter: String, expected: String, actual: String, mismatch: String, }, HeaderMismatch { key: String, expected: String, actual: String, mismatch: String, }, BodyTypeMismatch { expected: String, actual: String, }, BodyMismatch { path: String, expected: Option<String>, actual: Option<String>, mismatch: String, }, }
Enum that defines the different types of mismatches that can occur.
Variants
MethodMismatch
Request Method mismatch
Fields of MethodMismatch
expected: String | Expected request method |
actual: String | Actual request method |
PathMismatch
Request Path mismatch
Fields of PathMismatch
expected: String | expected request path |
actual: String | actual request path |
mismatch: String | description of the mismatch |
StatusMismatch
Response status mismatch
Fields of StatusMismatch
expected: u16 | expected response status |
actual: u16 | actual response status |
QueryMismatch
Request query mismatch
Fields of QueryMismatch
parameter: String | query parameter name |
expected: String | expected value |
actual: String | actual value |
mismatch: String | description of the mismatch |
HeaderMismatch
Header mismatch
Fields of HeaderMismatch
key: String | header key |
expected: String | expected value |
actual: String | actual value |
mismatch: String | description of the mismatch |
BodyTypeMismatch
Mismatch in the content type of the body
Fields of BodyTypeMismatch
expected: String | expected content type of the body |
actual: String | actual content type of the body |
BodyMismatch
Body element mismatch
Fields of BodyMismatch
path: String | path expression to where the mismatch occured |
expected: Option<String> | expected value |
actual: Option<String> | actual value |
mismatch: String | description of the mismatch |
Methods
impl Mismatch
[src]
fn to_json(&self) -> Value
[src]
Converts the mismatch to a Value
struct.
fn mismatch_type(&self) -> String
[src]
Returns the type of the mismatch as a string
fn summary(&self) -> String
[src]
Returns a summary string for this mismatch
fn description(&self) -> String
[src]
Returns a formated string for this mismatch
fn ansi_description(&self) -> String
[src]
Returns a formated string with ansi escape codes for this mismatch
Trait Implementations
impl Debug for Mismatch
[src]
impl Clone for Mismatch
[src]
fn clone(&self) -> Mismatch
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more