[][src]Enum pact_matching::Mismatch

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,
        mismatch: String,
    },
    BodyMismatch {
        path: String,
        expected: Option<Vec<u8>>,
        actual: Option<Vec<u8>>,
        mismatch: String,
    },
    MetadataMismatch {
        key: String,
        expected: String,
        actual: 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

mismatch: String

description of the mismatch

BodyMismatch

Body element mismatch

Fields of BodyMismatch

path: String

path expression to where the mismatch occurred

expected: Option<Vec<u8>>

expected value

actual: Option<Vec<u8>>

actual value

mismatch: String

description of the mismatch

MetadataMismatch

Message metadata mismatch

Fields of MetadataMismatch

key: String

key

expected: String

expected value

actual: String

actual value

mismatch: String

description of the mismatch

Implementations

impl Mismatch[src]

pub fn to_json(&self) -> Value[src]

Converts the mismatch to a Value struct.

pub fn mismatch_type(&self) -> String[src]

Returns the type of the mismatch as a string

pub fn summary(&self) -> String[src]

Returns a summary string for this mismatch

pub fn description(&self) -> String[src]

Returns a formated string for this mismatch

pub fn ansi_description(&self) -> String[src]

Returns a formatted string with ansi escape codes for this mismatch

Trait Implementations

impl Clone for Mismatch[src]

impl Debug for Mismatch[src]

impl Display for Mismatch[src]

impl PartialEq<Mismatch> for Mismatch[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,