safina-net
This is a safe Rust library for network communication.
It is part of safina
, a safe async runtime.
Features
forbid(unsafe_code)
- Depends only on
std
- Good test coverage (91%)
- Works with
safina-executor
or any async executor
Limitations
- Allocates
- Unoptimized
Documentation
Examples
let bind_addr =
from;
let mut listener =
bind
.unwrap;
let addr = listener.inner.local_addr.unwrap;
println!;
let executor = default;
executor.spawn;
let
= listener.accept.await.unwrap;
tcp_stream.write_all.await.unwrap;
println!;
For complete examples, see the integration tests in
tests/
.
Alternatives
async-net
- Dependencies are full of
unsafe
- Dependencies are full of
async-io
- Full of
unsafe
- Full of
tokio
- Very popular
- Fast
- Internally incredibly complicated
- Full of
unsafe
tcp-stream
- Blocks async executor threads
- Contains a little
unsafe
code
Changelog
- v0.1.3 - Increase test coverage
- v0.1.2
- Increase test coverage
- Handle spurious
EPROTOTYPE
errors on macOS.
- v0.1.1
- Add methods to
TcpStream
:peek
,read_vectored
,flush
, andwrite_vectored
. - Support Windows
- Add methods to
- v0.1.0 - First published version
TO DO
- DONE - Implement
TcpListener
andTcpStream
with tests & docs - DONE - Publish on crates.io
- Add additional crates with adapters to popular async io traits, like safina-net-tokio, safina-net-futures, etc.
Release Process
- Edit
Cargo.toml
and bump version number. - Run
./release.sh
License: Apache-2.0