[][src]Module httptest::matchers

Matcher implementations.

This module contains matchers for composing a set of operations. The result of the composition usually results in a boolean.

Modules

request

Matchers that extract information from HTTP requests.

Macros

all_of

true if all the provided matchers return true.

any_of

true if any of the provided matchers return true.

Structs

AllOf

The AllOf mapper returned by all_of()

Any

The Any mapper returned by any()

AnyOf

The AnyOf mapper returned by any_of()

Contains

The Contains mapper returned by contains()

Eq

The Eq mapper returned by eq()

ExecutionContext

An ExecutionContext tracks how Matchers are chained together. There is a single public method called chain that when used to chain input from one matcher to another will allow tracking the flow of data across composable matchers.

JsonDecoded

The JsonDecoded mapper returned by json_decoded()

KV

A key-value pair.

Key

The Key mapper returned by key()

Len

The Len mapper returned by len()

Lowercase

The Lowercase mapper returned by lowercase()

Matches

The Matches mapper returned by matches()

Not

The Not mapper returned by not()

UrlDecoded

The UrlDecoded mapper returned by url_decoded()

Value

The Value mapper returned by value()

Traits

IntoRegex

Create a regex.

Matcher

The core trait. Defines how an input value should be turned into an output value. This allows for a flexible pattern of composition where two or more matchers are chained together to form a readable and flexible manipulation.

Functions

all_of

true if all the provided matchers return true. See the all_of! macro for convenient usage.

any

Always true.

any_of

true if any of the provided matchers returns true. See the any_of! macro for convenient usage.

contains

true if any input element matches the provided mapper.

eq

true if the input is equal to value.

json_decoded

json decode the input and pass the resulting value to the inner mapper. If the input cannot be decoded a false value is returned.

key

extract the key from a key-value pair.

len

extract the length of the input.

lowercase

lowercase the input and pass it to the next mapper.

matches

true if the input matches the regex provided.

not

invert the result of the inner mapper.

url_decoded

url decode the input and pass the resulting slice of key-value pairs to the next mapper.

value

extract the value from a key-value pair.