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

Request Method mismatch

Fields

Expected request method

Actual request method

Request Path mismatch

Fields

expected request path

actual request path

description of the mismatch

Response status mismatch

Fields

expected response status

actual response status

Request query mismatch

Fields

query parameter name

expected value

actual value

description of the mismatch

Header mismatch

Fields

header key

expected value

actual value

description of the mismatch

Mismatch in the content type of the body

Fields

expected content type of the body

actual content type of the body

Body element mismatch

Fields

path expression to where the mismatch occured

expected value

actual value

description of the mismatch

Methods

impl Mismatch
[src]

Converts the mismatch to a Json struct.

Returns the type of the mismatch as a string

Returns a summary string for this mismatch

Returns a formated string for this mismatch

Returns a formated string with ansi escape codes for this mismatch

Trait Implementations

impl Debug for Mismatch
[src]

Formats the value using the given formatter.

impl Clone for Mismatch
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Mismatch
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.