pub enum Mismatch {
    MethodMismatch {
        expected: String,
        actual: String,
    },
    PathMismatch {
        expected: String,
        actual: String,
        mismatch: String,
    },
    StatusMismatch {
        expected: u16,
        actual: u16,
        mismatch: String,
    },
    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,
    },
}
Expand description

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

Variants§

§

MethodMismatch

Fields

§expected: String

Expected request method

§actual: String

Actual request method

Request Method mismatch

§

PathMismatch

Fields

§expected: String

expected request path

§actual: String

actual request path

§mismatch: String

description of the mismatch

Request Path mismatch

§

StatusMismatch

Fields

§expected: u16

expected response status

§actual: u16

actual response status

§mismatch: String

description of the mismatch

Response status mismatch

§

QueryMismatch

Fields

§parameter: String

query parameter name

§expected: String

expected value

§actual: String

actual value

§mismatch: String

description of the mismatch

Request query mismatch

§

HeaderMismatch

Fields

§key: String

header key

§expected: String

expected value

§actual: String

actual value

§mismatch: String

description of the mismatch

Header mismatch

§

BodyTypeMismatch

Fields

§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

Mismatch in the content type of the body

§

BodyMismatch

Fields

§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

Body element mismatch

§

MetadataMismatch

Fields

§key: String

key

§expected: String

expected value

§actual: String

actual value

§mismatch: String

description of the mismatch

Message metadata mismatch

Implementations§

Converts the mismatch to a Value struct.

Returns the type of the mismatch as a string

Returns a summary string for this mismatch

Returns a formatted string for this mismatch

Returns a formatted string with ansi escape codes for this mismatch

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
Give this value the specified foreground colour
Give this value the specified background colour

Returns the argument unchanged.

Converts to this type from a reference to the input type.
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more