Skip to content

Commit

Permalink
Crate docs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-smoktal committed Apr 8, 2024
1 parent 9e64d4c commit ac53304
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@
//!
//! ## Examles
//! See [test_raw_fd.rs](https://github.com/alexander-smoktal/async-send-fd/blob/main/tests/test_raw_fd.rs),
//! [test_smol_stream.rs](https://github.com/alexander-smoktal/async-send-fd/blob/main/tests/test_smol_fd.rs) or
//! [test_smol_stream.rs](https://github.com/alexander-smoktal/async-send-fd/blob/main/tests/test_smol_stream.rs) or
//! [test_tokio_stream.rs](https://github.com/alexander-smoktal/async-send-fd/blob/main/tests/test_tokio_stream.rs) for examples.
//!
//! ## Creating a Tokio [UnixStream](tokio::net::UnixStream) from [RawFd]
//! If you make a Tokio [UnixStream](tokio::net::UnixStream) from a raw file descriptor made by an
//! OS call (e.g. [UnixStream::pair](std::os::unix::net::UnixStream::pair())), you must make it
//! [set_nonblocking(true)](std::os::unix::net::UnixStream::set_nonblocking()), otherwise receivers scheduler will block
//! writing into the socket ⚠️
//!
//! Smol [UnixStream](smol::net::unix::UnixStream) makes it automatically if created using `UnixStream::from(Async::new(stream))`
//!
//! ## Transfering socket pair ownership
//! Sending a descriptor doesn't close the local copy, which leads to having the socket being
//! opened by the sender until it shuts down.
//! If you want socket pair receivers to detect peer shutdown, you have to close local sockets after sending them.
//!
//! Use [close](https://docs.rs/nix/latest/nix/unistd/fn.close.html) Posix call for Tokio streams, or [UnixStream::shutdown()](smol::net::unix::UnixStream::shutdown) for Smol.
//!
//! ## Features
Expand Down

0 comments on commit ac53304

Please sign in to comment.