mock-io
A crate with mock IO stream and listener implementations.
Usage
Add mock-io
in your Cargo.toml
's dependencies
section:
[]
= "0.3"
Here is a sample usage of this crate:
use ;
let = new;
spawn;
while let Ok = listener.accept
Features
sync
: Enables sync mock IO stream and listener- Enabled by default
async-futures
: Enables async mock IO stream and listener (usingfutures::io::{AsyncRead, AsyncWrite}
)- Disabled by default
async-tokio
: Enables async mock IO stream and listener (usingtokio::io::{AsyncRead, AsyncWrite}
)- Disabled by default
Note: Some functions in this crate returns a
Future
. So, you'll need an executor to driveFuture
s returned from these functions.async-std
andtokio
are two popular options.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.