[][src]Module tokio_test::io

A mock type implementing [AsyncRead] and [AsyncWrite].

Overview

Provides a type that implements [AsyncRead] + [AsyncWrite] that can be configured to handle an arbitrary sequence of read and write operations. This is useful for writing unit tests for networking services as using an actual network type is fairly non deterministic.

Usage

Attempting to write data that the mock isn't expected will result in a panic.

Structs

Builder

Builds Mock instances.

Handle

A handle to send additional actions to the related Mock.

Mock

An I/O object that follows a predefined script.