- pub fn tcp_client<A: ToSocketAddrs + std::fmt::Display>(ip_addrs: A) -> anyhow::Result<Self> {
- let stream = futures::executor::block_on(TcpStream::connect(&ip_addrs))?;
+ /// Creates a [`Connection`] that uses a TCP transport.
+ ///
+ /// # Example
+ ///
+ /// Please see the [tcp-client](https://github.com/sachanganesh/connect-rs/blob/main/examples/tcp-client/src/main.rs)
+ /// example program for a more thorough showcase.
+ ///
+ /// Basic usage:
+ ///
+ /// ```ignore
+ /// let mut conn = Connection::tcp_client("127.0.0.1:3456").await?;
+ /// ```
+ pub async fn tcp_client<A: ToSocketAddrs + std::fmt::Display>(
+ ip_addrs: A,
+ ) -> anyhow::Result<Self> {
+ let stream = TcpStream::connect(&ip_addrs).await?;