[][src]Module httptest::mappers

Mapper implementations.

This module contains mappers for composing a set of operations. The result of the composition usually results in a boolean. Any Mapper that results in a boolean value also implemens Matcher.

Modules

request

Mappers that extract information from HTTP requests.

response

Mappers that extract information from HTTP responses.

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()

ContainsEntry

The ContainsEntry mapper returned by contains_entry()

Eq

The Eq mapper returned by eq()

Inspect

The Inspect mapper returned by inspect()

JsonDecoded

The JsonDecoded mapper returned by json_decoded()

KV

A key-value pair.

Key

The Key mapper returned by key()

Lowercase

The Lowercase mapper returned by lowercase()

MapFn

The MapFn mapper returned by map_fn()

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.

Mapper

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 mappers are chained together to form a readable and flexible manipulation.

Matcher

Matcher is just a special case of Mapper that returns a boolean. It simply provides the matches method rather than map as that reads a little better.

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_entry

true if the provided mapper returns true for any of the elements in the sequence.

eq

true if the input is equal to value.

inspect

inspect the input and pass it to the next mapper.

json_decoded

json decode the input and pass the resulting serde_json::Value to the next mapper.

key

extract the key from a key-value pair.

kv

Create a KV from the provided key-value pair.

lowercase

lowercase the input and pass it to the next mapper.

map_fn

pass the input to the provided Fn(T) -> bool and return the result.

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.