A small and fast async runtime for Rust.
This runtime extends the standard library with async combinators and is only 1500 lines of code long.
Reading the [docs] or looking at the [examples] is a good way of starting to learn async Rust.
Async I/O is implemented using [epoll] on Linux/Android, [kqueue] on macOS/iOS/BSD, and [wepoll] on Windows.
!Send
futures.See this example for how to use smol with [async-std], [tokio], [surf], and [reqwest].
There is an optional feature for seamless integration with crates depending on tokio. It creates a global tokio runtime and sets up its context inside smol. Enable the feature as follows:
toml
[dependencies]
smol = { version = "0.1", features = ["tokio02"] }
You can read the docs here, or generate them on your own.
If you'd like to explore the implementation in more depth, the following command generates docs for the whole crate, including private modules:
cargo doc --document-private-items --no-deps --open
My personal crate recommendation list:
Some code examples are using TLS for authentication.
To access HTTPS servers from your browser, you'll first need to import the certificate from this repository (Chrome/Firefox):
certificate.pem
.The certificate file was generated using minica and openssl:
minica --domains localhost -ip-addresses 127.0.0.1 -ca-cert certificate.pem
openssl pkcs12 -export -out identity.pfx -inkey localhost/key.pem -in localhost/cert.pem
Licensed under either of
at your option.
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.