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,
        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,
    },
}

Enum that defines the different types of mismatches that can occur.

Variants

MethodMismatch

Request Method mismatch

Show fields

Fields of MethodMismatch

expected: String

Expected request method

actual: String

Actual request method

PathMismatch

Request Path mismatch

Show fields

Fields of PathMismatch

expected: String

expected request path

actual: String

actual request path

mismatch: String

description of the mismatch

StatusMismatch

Response status mismatch

Show fields

Fields of StatusMismatch

expected: u16

expected response status

actual: u16

actual response status

QueryMismatch

Request query mismatch

Show fields

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

Show fields

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

Show fields

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

expected_body: Option<Bytes>

expected value

actual_body: Option<Bytes>

actual value

BodyMismatch

Body element mismatch

Show fields

Fields of BodyMismatch

path: String

path expression to where the mismatch occurred

expected: Option<Bytes>

expected value

actual: Option<Bytes>

actual value

mismatch: String

description of the mismatch

MetadataMismatch

Message metadata mismatch

Show fields

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> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

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

impl<T> Instrument for T[src]

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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> TryConv for T

impl<T> TryConv for T

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<V, T> VZip<V> for T where
    V: MultiLane<T>,